
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/physics/control/lti.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:27:30 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Control API &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
    <script src="../../../_static/jquery.js"></script>
    <script src="../../../_static/underscore.js"></script>
    <script src="../../../_static/doctools.js"></script>
    <script src="../../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../../_static/sympy-notailtext-favicon.ico"/>
    <link href="lti.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />
    <link rel="next" title="Control System Plots" href="control_plots.html" />
    <link rel="prev" title="Control" href="control.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="control_plots.html" title="Control System Plots"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="control.html" title="Control"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="index.html" accesskey="U">Control Module</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Control API</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="control-api">
<h1>Control API<a class="headerlink" href="#control-api" title="Permalink to this headline">¶</a></h1>
<section id="module-sympy.physics.control.lti">
<span id="lti"></span><h2>lti<a class="headerlink" href="#module-sympy.physics.control.lti" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.control.lti.</span></span><span class="sig-name descname"><span class="pre">TransferFunction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">num</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">den</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">var</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L85-L759"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing LTI (Linear, time-invariant) systems that can be strictly described
by ratio of polynomials in the Laplace transform complex variable. The arguments
are <code class="docutils literal notranslate"><span class="pre">num</span></code>, <code class="docutils literal notranslate"><span class="pre">den</span></code>, and <code class="docutils literal notranslate"><span class="pre">var</span></code>, where <code class="docutils literal notranslate"><span class="pre">num</span></code> and <code class="docutils literal notranslate"><span class="pre">den</span></code> are numerator and
denominator polynomials of the <code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code> respectively, and the third argument is
a complex variable of the Laplace transform used by these polynomials of the transfer function.
<code class="docutils literal notranslate"><span class="pre">num</span></code> and <code class="docutils literal notranslate"><span class="pre">den</span></code> can be either polynomials or numbers, whereas <code class="docutils literal notranslate"><span class="pre">var</span></code>
has to be a Symbol.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>num</strong> : Expr, Number</p>
<blockquote>
<div><p>The numerator polynomial of the transfer function.</p>
</div></blockquote>
<p><strong>den</strong> : Expr, Number</p>
<blockquote>
<div><p>The denominator polynomial of the transfer function.</p>
</div></blockquote>
<p><strong>var</strong> : Symbol</p>
<blockquote>
<div><p>Complex variable of the Laplace transform used by the
polynomials of the transfer function.</p>
</div></blockquote>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>TypeError</strong></p>
<blockquote>
<div><p>When <code class="docutils literal notranslate"><span class="pre">var</span></code> is not a Symbol or when <code class="docutils literal notranslate"><span class="pre">num</span></code> or <code class="docutils literal notranslate"><span class="pre">den</span></code> is not a
number or a polynomial.</p>
</div></blockquote>
<p><strong>ValueError</strong></p>
<blockquote>
<div><p>When <code class="docutils literal notranslate"><span class="pre">den</span></code> is zero.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>Generally, a dynamical system representing a physical model can be described in terms of Linear
Ordinary Differential Equations like -</p>
<blockquote>
<div><p><span class="math notranslate nohighlight">\(\small{b_{m}y^{\left(m\right)}+b_{m-1}y^{\left(m-1\right)}+\dots+b_{1}y^{\left(1\right)}+b_{0}y=
a_{n}x^{\left(n\right)}+a_{n-1}x^{\left(n-1\right)}+\dots+a_{1}x^{\left(1\right)}+a_{0}x}\)</span></p>
</div></blockquote>
<p>Here, <span class="math notranslate nohighlight">\(x\)</span> is the input signal and <span class="math notranslate nohighlight">\(y\)</span> is the output signal and superscript on both is the order of derivative
(not exponent). Derivative is taken with respect to the independent variable, <span class="math notranslate nohighlight">\(t\)</span>. Also, generally <span class="math notranslate nohighlight">\(m\)</span> is greater
than <span class="math notranslate nohighlight">\(n\)</span>.</p>
<p>It is not feasible to analyse the properties of such systems in their native form therefore, we use
mathematical tools like Laplace transform to get a better perspective. Taking the Laplace transform
of both the sides in the equation (at zero initial conditions), we get -</p>
<blockquote>
<div><p><span class="math notranslate nohighlight">\(\small{\mathcal{L}[b_{m}y^{\left(m\right)}+b_{m-1}y^{\left(m-1\right)}+\dots+b_{1}y^{\left(1\right)}+b_{0}y]=
\mathcal{L}[a_{n}x^{\left(n\right)}+a_{n-1}x^{\left(n-1\right)}+\dots+a_{1}x^{\left(1\right)}+a_{0}x]}\)</span></p>
</div></blockquote>
<p>Using the linearity property of Laplace transform and also considering zero initial conditions
(i.e. <span class="math notranslate nohighlight">\(\small{y(0^{-}) = 0}\)</span>, <span class="math notranslate nohighlight">\(\small{y'(0^{-}) = 0}\)</span> and so on), the equation
above gets translated to -</p>
<blockquote>
<div><p><span class="math notranslate nohighlight">\(\small{b_{m}\mathcal{L}[y^{\left(m\right)}]+\dots+b_{1}\mathcal{L}[y^{\left(1\right)}]+b_{0}\mathcal{L}[y]=
a_{n}\mathcal{L}[x^{\left(n\right)}]+\dots+a_{1}\mathcal{L}[x^{\left(1\right)}]+a_{0}\mathcal{L}[x]}\)</span></p>
</div></blockquote>
<p>Now, applying Derivative property of Laplace transform,</p>
<blockquote>
<div><p><span class="math notranslate nohighlight">\(\small{b_{m}s^{m}\mathcal{L}[y]+\dots+b_{1}s\mathcal{L}[y]+b_{0}\mathcal{L}[y]=
a_{n}s^{n}\mathcal{L}[x]+\dots+a_{1}s\mathcal{L}[x]+a_{0}\mathcal{L}[x]}\)</span></p>
</div></blockquote>
<p>Here, the superscript on <span class="math notranslate nohighlight">\(s\)</span> is <strong>exponent</strong>. Note that the zero initial conditions assumption, mentioned above, is very important
and cannot be ignored otherwise the dynamical system cannot be considered time-independent and the simplified equation above
cannot be reached.</p>
<p>Collecting <span class="math notranslate nohighlight">\(\mathcal{L}[y]\)</span> and <span class="math notranslate nohighlight">\(\mathcal{L}[x]\)</span> terms from both the sides and taking the ratio
<span class="math notranslate nohighlight">\(\frac{ \mathcal{L}\left\{y\right\} }{ \mathcal{L}\left\{x\right\} }\)</span>, we get the typical rational form of transfer
function.</p>
<p>The numerator of the transfer function is, therefore, the Laplace transform of the output signal
(The signals are represented as functions of time) and similarly, the denominator
of the transfer function is the Laplace transform of the input signal. It is also a convention
to denote the input and output signal’s Laplace transform with capital alphabets like shown below.</p>
<blockquote>
<div><p><span class="math notranslate nohighlight">\(H(s) = \frac{Y(s)}{X(s)} = \frac{ \mathcal{L}\left\{y(t)\right\} }{ \mathcal{L}\left\{x(t)\right\} }\)</span></p>
</div></blockquote>
<p><span class="math notranslate nohighlight">\(s\)</span>, also known as complex frequency, is a complex variable in the Laplace domain. It corresponds to the
equivalent variable <span class="math notranslate nohighlight">\(t\)</span>, in the time domain. Transfer functions are sometimes also referred to as the Laplace
transform of the system’s impulse response. Transfer function, <span class="math notranslate nohighlight">\(H\)</span>, is represented as a rational
function in <span class="math notranslate nohighlight">\(s\)</span> like,</p>
<blockquote>
<div><p><span class="math notranslate nohighlight">\(H(s) =\ \frac{a_{n}s^{n}+a_{n-1}s^{n-1}+\dots+a_{1}s+a_{0}}{b_{m}s^{m}+b_{m-1}s^{m-1}+\dots+b_{1}s+b_{0}}\)</span></p>
</div></blockquote>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="n">a</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span>
<span class="go">TransferFunction(a + s, s**2 + s + 1, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">num</span>
<span class="go">a + s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">den</span>
<span class="go">s**2 + s + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">args</span>
<span class="go">(a + s, s**2 + s + 1, s)</span>
</pre></div>
</div>
<p>Any complex variable can be used for <code class="docutils literal notranslate"><span class="pre">var</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span><span class="o">*</span><span class="n">p</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="n">a</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span>
<span class="go">TransferFunction(a*p**3 - a*p**2 + p*s, a**2 + p, p)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="n">p</span> <span class="o">+</span> <span class="mi">3</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">+</span> <span class="mi">5</span><span class="p">),</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span>
<span class="go">TransferFunction((p - 1)*(p + 3), (p - 1)*(p + 5), p)</span>
</pre></div>
</div>
<p>To negate a transfer function the <code class="docutils literal notranslate"><span class="pre">-</span></code> operator can be prepended:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tf4</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="o">-</span><span class="n">a</span> <span class="o">+</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="o">-</span><span class="n">tf4</span>
<span class="go">TransferFunction(a - s, p**2 + s, p)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf5</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="o">-</span><span class="n">tf5</span>
<span class="go">TransferFunction(-s**4 + 2*s**3 - 5*s - 4, s + 4, s)</span>
</pre></div>
</div>
<p>You can use a Float or an Integer (or other constants) as numerator and denominator:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tf6</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf6</span><span class="o">.</span><span class="n">num</span>
<span class="go">0.500000000000000</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf6</span><span class="o">.</span><span class="n">den</span>
<span class="go">4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf6</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf6</span><span class="o">.</span><span class="n">args</span>
<span class="go">(0.5, 4, s)</span>
</pre></div>
</div>
<p>You can take the integer power of a transfer function using the <code class="docutils literal notranslate"><span class="pre">**</span></code> operator:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tf7</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="n">a</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">a</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf7</span><span class="o">**</span><span class="mi">3</span>
<span class="go">TransferFunction((a + s)**3, (-a + s)**3, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf7</span><span class="o">**</span><span class="mi">0</span>
<span class="go">TransferFunction(1, 1, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf8</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">p</span> <span class="o">-</span> <span class="mi">3</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf8</span><span class="o">**-</span><span class="mi">1</span>
<span class="go">TransferFunction(p - 3, p + 4, p)</span>
</pre></div>
</div>
<p>Addition, subtraction, and multiplication of transfer functions can form
unevaluated <code class="docutils literal notranslate"><span class="pre">Series</span></code> or <code class="docutils literal notranslate"><span class="pre">Parallel</span></code> objects.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tf9</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf10</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf11</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">4</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">4</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf12</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf9</span> <span class="o">+</span> <span class="n">tf10</span>
<span class="go">Parallel(TransferFunction(s + 1, s**2 + s + 1, s), TransferFunction(-p + s, s + 3, s))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf10</span> <span class="o">-</span> <span class="n">tf11</span>
<span class="go">Parallel(TransferFunction(-p + s, s + 3, s), TransferFunction(-4*s**2 - 2*s + 4, s - 1, s))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf9</span> <span class="o">*</span> <span class="n">tf10</span>
<span class="go">Series(TransferFunction(s + 1, s**2 + s + 1, s), TransferFunction(-p + s, s + 3, s))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf10</span> <span class="o">-</span> <span class="p">(</span><span class="n">tf9</span> <span class="o">+</span> <span class="n">tf12</span><span class="p">)</span>
<span class="go">Parallel(TransferFunction(-p + s, s + 3, s), TransferFunction(-s - 1, s**2 + s + 1, s), TransferFunction(s - 1, s**2 + 4, s))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf10</span> <span class="o">-</span> <span class="p">(</span><span class="n">tf9</span> <span class="o">*</span> <span class="n">tf12</span><span class="p">)</span>
<span class="go">Parallel(TransferFunction(-p + s, s + 3, s), Series(TransferFunction(-1, 1, s), TransferFunction(s + 1, s**2 + s + 1, s), TransferFunction(1 - s, s**2 + 4, s)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf11</span> <span class="o">*</span> <span class="n">tf10</span> <span class="o">*</span> <span class="n">tf9</span>
<span class="go">Series(TransferFunction(4*s**2 + 2*s - 4, s - 1, s), TransferFunction(-p + s, s + 3, s), TransferFunction(s + 1, s**2 + s + 1, s))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf9</span> <span class="o">*</span> <span class="n">tf11</span> <span class="o">+</span> <span class="n">tf10</span> <span class="o">*</span> <span class="n">tf12</span>
<span class="go">Parallel(Series(TransferFunction(s + 1, s**2 + s + 1, s), TransferFunction(4*s**2 + 2*s - 4, s - 1, s)), Series(TransferFunction(-p + s, s + 3, s), TransferFunction(1 - s, s**2 + 4, s)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">tf9</span> <span class="o">+</span> <span class="n">tf12</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="n">tf10</span> <span class="o">+</span> <span class="n">tf11</span><span class="p">)</span>
<span class="go">Series(Parallel(TransferFunction(s + 1, s**2 + s + 1, s), TransferFunction(1 - s, s**2 + 4, s)), Parallel(TransferFunction(-p + s, s + 3, s), TransferFunction(4*s**2 + 2*s - 4, s - 1, s)))</span>
</pre></div>
</div>
<p>These unevaluated <code class="docutils literal notranslate"><span class="pre">Series</span></code> or <code class="docutils literal notranslate"><span class="pre">Parallel</span></code> objects can convert into the
resultant transfer function using <code class="docutils literal notranslate"><span class="pre">.doit()</span></code> method or by <code class="docutils literal notranslate"><span class="pre">.rewrite(TransferFunction)</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">((</span><span class="n">tf9</span> <span class="o">+</span> <span class="n">tf10</span><span class="p">)</span> <span class="o">*</span> <span class="n">tf12</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((1 - s)*((-p + s)*(s**2 + s + 1) + (s + 1)*(s + 3)), (s + 3)*(s**2 + 4)*(s**2 + s + 1), s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">tf9</span> <span class="o">*</span> <span class="n">tf10</span> <span class="o">-</span> <span class="n">tf11</span> <span class="o">*</span> <span class="n">tf12</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">TransferFunction</span><span class="p">)</span>
<span class="go">TransferFunction(-(1 - s)*(s + 3)*(s**2 + s + 1)*(4*s**2 + 2*s - 4) + (-p + s)*(s - 1)*(s + 1)*(s**2 + 4), (s - 1)*(s + 3)*(s**2 + 4)*(s**2 + s + 1), s)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.Feedback" title="sympy.physics.control.lti.Feedback"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Feedback</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.Series" title="sympy.physics.control.lti.Series"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Series</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.Parallel" title="sympy.physics.control.lti.Parallel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Parallel</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r607"><span class="brackets"><a class="fn-backref" href="#id1">R607</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Transfer_function">https://en.wikipedia.org/wiki/Transfer_function</a></p>
</dd>
<dt class="label" id="r608"><span class="brackets"><a class="fn-backref" href="#id2">R608</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Laplace_transform">https://en.wikipedia.org/wiki/Laplace_transform</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.dc_gain">
<span class="sig-name descname"><span class="pre">dc_gain</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L467-L493"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.dc_gain" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the gain of the response as the frequency approaches zero.</p>
<p>The DC gain is infinite for systems with pure integrators.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">9</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">dc_gain</span><span class="p">()</span>
<span class="go">-1/3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">p</span> <span class="o">-</span> <span class="mi">3</span> <span class="o">+</span> <span class="n">p</span><span class="o">**</span><span class="mi">3</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span><span class="o">.</span><span class="n">dc_gain</span><span class="p">()</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">b</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="n">b</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span><span class="o">.</span><span class="n">dc_gain</span><span class="p">()</span>
<span class="go">(a*p**2 - b)/b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf4</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf4</span><span class="o">.</span><span class="n">dc_gain</span><span class="p">()</span>
<span class="go">oo</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.den">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">den</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.den" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the denominator polynomial of the transfer function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span><span class="o">.</span><span class="n">den</span>
<span class="go">p**3 - 2*p + 4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span><span class="o">.</span><span class="n">den</span>
<span class="go">4</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.expand">
<span class="sig-name descname"><span class="pre">expand</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L447-L465"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.expand" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the transfer function with numerator and denominator
in expanded form.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="n">a</span> <span class="o">-</span> <span class="n">s</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">a</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span><span class="o">.</span><span class="n">expand</span><span class="p">()</span>
<span class="go">TransferFunction(a**2 - 2*a*s + s**2, a**2 + 2*a*s**2 + s**4, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="n">p</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">b</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="n">b</span><span class="p">),</span> <span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="n">b</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">b</span><span class="p">),</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span><span class="o">.</span><span class="n">expand</span><span class="p">()</span>
<span class="go">TransferFunction(-3*b**2 + 2*b*p + p**2, -2*b**2 + b*p + p**2, p)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.from_rational_expression">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">from_rational_expression</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">expr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">var</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L291-L367"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.from_rational_expression" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a new <code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code> efficiently from a rational expression.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>expr</strong> : Expr, Number</p>
<blockquote>
<div><p>The rational expression representing the <code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code>.</p>
</div></blockquote>
<p><strong>var</strong> : Symbol, optional</p>
<blockquote>
<div><p>Complex variable of the Laplace transform used by the
polynomials of the transfer function.</p>
</div></blockquote>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong></p>
<blockquote>
<div><p>When <code class="docutils literal notranslate"><span class="pre">expr</span></code> is of type <code class="docutils literal notranslate"><span class="pre">Number</span></code> and optional parameter <code class="docutils literal notranslate"><span class="pre">var</span></code>
is not passed.</p>
<p>When <code class="docutils literal notranslate"><span class="pre">expr</span></code> has more than one variables and an optional parameter
<code class="docutils literal notranslate"><span class="pre">var</span></code> is not passed.</p>
</div></blockquote>
<p><strong>ZeroDivisionError</strong></p>
<blockquote>
<div><p>When denominator of <code class="docutils literal notranslate"><span class="pre">expr</span></code> is zero or it has <code class="docutils literal notranslate"><span class="pre">ComplexInfinity</span></code>
in its numerator.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr1</span> <span class="o">=</span> <span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">5</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="o">.</span><span class="n">from_rational_expression</span><span class="p">(</span><span class="n">expr1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span>
<span class="go">TransferFunction(s + 5, 3*s**2 + 2*s + 1, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr2</span> <span class="o">=</span> <span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span><span class="o">*</span><span class="n">p</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">p</span> <span class="o">+</span> <span class="n">a</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>  <span class="c1"># Expr with more than one variables</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="o">.</span><span class="n">from_rational_expression</span><span class="p">(</span><span class="n">expr2</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span>
<span class="go">TransferFunction(a*p**3 - a*p**2 + p*s, a**2 + p, p)</span>
</pre></div>
</div>
<p>In case of conflict between two or more variables in a expression, SymPy will
raise a <code class="docutils literal notranslate"><span class="pre">ValueError</span></code>, if <code class="docutils literal notranslate"><span class="pre">var</span></code> is not passed by the user.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tf</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="o">.</span><span class="n">from_rational_expression</span><span class="p">((</span><span class="n">a</span> <span class="o">+</span> <span class="n">a</span><span class="o">*</span><span class="n">s</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">))</span>
<span class="gt">Traceback (most recent call last):</span>
<span class="c">...</span>
<span class="gr">ValueError</span>: <span class="n">Conflicting values found for positional argument `var` ({a, s}). Specify it manually.</span>
</pre></div>
</div>
<p>This can be corrected by specifying the <code class="docutils literal notranslate"><span class="pre">var</span></code> parameter manually.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tf</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="o">.</span><span class="n">from_rational_expression</span><span class="p">((</span><span class="n">a</span> <span class="o">+</span> <span class="n">a</span><span class="o">*</span><span class="n">s</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf</span>
<span class="go">TransferFunction(a*s + a, s**2 + s + 1, s)</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">var</span></code> also need to be specified when <code class="docutils literal notranslate"><span class="pre">expr</span></code> is a <code class="docutils literal notranslate"><span class="pre">Number</span></code></p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="o">.</span><span class="n">from_rational_expression</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span>
<span class="go">TransferFunction(10, 1, s)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.is_biproper">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_biproper</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.is_biproper" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if degree of the numerator polynomial is equal to
degree of the denominator polynomial, else False.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">is_biproper</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="n">a</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span><span class="o">.</span><span class="n">is_biproper</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.is_proper">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_proper</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.is_proper" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if degree of the numerator polynomial is less than
or equal to degree of the denominator polynomial, else False.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">a</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="n">s</span><span class="p">,</span> <span class="n">b</span> <span class="o">-</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">is_proper</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span><span class="o">.</span><span class="n">is_proper</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.is_stable">
<span class="sig-name descname"><span class="pre">is_stable</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L539-L566"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.is_stable" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if the transfer function is asymptotically stable; else False.</p>
<p>This would not check the marginal or conditional stability of the system.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q</span><span class="p">,</span> <span class="n">r</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;q, r&#39;</span><span class="p">,</span> <span class="n">negative</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="mi">1</span> <span class="o">-</span> <span class="n">s</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">is_stable</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="mi">1</span> <span class="o">-</span> <span class="n">p</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span><span class="o">.</span><span class="n">is_stable</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="n">q</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="n">r</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span><span class="o">.</span><span class="n">is_stable</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf4</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">a</span><span class="o">*</span><span class="n">p</span> <span class="o">-</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf4</span><span class="o">.</span><span class="n">is_stable</span><span class="p">()</span> <span class="ow">is</span> <span class="kc">None</span>   <span class="c1"># Not enough info about the symbols to determine stability</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.is_strictly_proper">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_strictly_proper</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.is_strictly_proper" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if degree of the numerator polynomial is strictly less
than degree of the denominator polynomial, else False.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">is_strictly_proper</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span><span class="o">.</span><span class="n">is_strictly_proper</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.num">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">num</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.num" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the numerator polynomial of the transfer function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">p</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="mi">4</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span><span class="o">.</span><span class="n">num</span>
<span class="go">p*s + s**2 + 3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="n">p</span> <span class="o">+</span> <span class="mi">5</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="mi">3</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span><span class="o">.</span><span class="n">num</span>
<span class="go">(p - 3)*(p + 5)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.poles">
<span class="sig-name descname"><span class="pre">poles</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L495-L515"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.poles" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the poles of a transfer function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="n">p</span> <span class="o">+</span> <span class="mi">3</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">+</span> <span class="mi">5</span><span class="p">),</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">poles</span><span class="p">()</span>
<span class="go">[-5, 1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="mi">1</span> <span class="o">-</span> <span class="n">s</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span><span class="o">.</span><span class="n">poles</span><span class="p">()</span>
<span class="go">[I, I, -I, -I]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">a</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span><span class="o">.</span><span class="n">poles</span><span class="p">()</span>
<span class="go">[-p/a]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.to_expr">
<span class="sig-name descname"><span class="pre">to_expr</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L732-L759"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.to_expr" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a <code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code> object to SymPy Expr.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Expr</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">a</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">to_expr</span><span class="p">()</span>
<span class="go">s/(a*s**2 + 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">Expr</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="p">(</span><span class="n">p</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">b</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">b</span> <span class="o">-</span> <span class="n">p</span><span class="p">),</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span><span class="o">.</span><span class="n">to_expr</span><span class="p">()</span>
<span class="go">1/((b - p)*(3*b + p))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="n">s</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">s</span> <span class="o">-</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="n">s</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">s</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">s</span> <span class="o">-</span> <span class="mi">3</span><span class="p">),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span><span class="o">.</span><span class="n">to_expr</span><span class="p">()</span>
<span class="go">((s - 3)*(s - 2))/(((s - 3)*(s - 2)*(s - 1)))</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.var">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">var</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.var" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complex variable of the Laplace transform used by the polynomials of
the transfer function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">p</span> <span class="o">-</span> <span class="mi">6</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="mi">5</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunction.zeros">
<span class="sig-name descname"><span class="pre">zeros</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L517-L537"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunction.zeros" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the zeros of a transfer function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="n">p</span> <span class="o">+</span> <span class="mi">3</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="n">p</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">p</span> <span class="o">+</span> <span class="mi">5</span><span class="p">),</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span><span class="o">.</span><span class="n">zeros</span><span class="p">()</span>
<span class="go">[-3, 1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">((</span><span class="mi">1</span> <span class="o">-</span> <span class="n">s</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span><span class="o">.</span><span class="n">zeros</span><span class="p">()</span>
<span class="go">[1, 1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">a</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span><span class="o">.</span><span class="n">zeros</span><span class="p">()</span>
<span class="go">[0, 0]</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Series">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.control.lti.</span></span><span class="sig-name descname"><span class="pre">Series</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evaluate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L785-L1037"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.Series" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing a series configuration of SISO systems.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>args</strong> : SISOLinearTimeInvariant</p>
<blockquote>
<div><p>SISO systems in a series configuration.</p>
</div></blockquote>
<p><strong>evaluate</strong> : Boolean, Keyword</p>
<blockquote>
<div><p>When passed <code class="docutils literal notranslate"><span class="pre">True</span></code>, returns the equivalent
<code class="docutils literal notranslate"><span class="pre">Series(*args).doit()</span></code>. Set to <code class="docutils literal notranslate"><span class="pre">False</span></code> by default.</p>
</div></blockquote>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong></p>
<blockquote>
<div><p>When no argument is passed.</p>
<p><code class="docutils literal notranslate"><span class="pre">var</span></code> attribute is not same for every system.</p>
</div></blockquote>
<p><strong>TypeError</strong></p>
<blockquote>
<div><p>Any of the passed <code class="docutils literal notranslate"><span class="pre">*args</span></code> has unsupported type</p>
<p>A combination of SISO and MIMO systems is
passed. There should be homogeneity in the
type of systems passed, SISO in this case.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Series</span><span class="p">,</span> <span class="n">Parallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span>
<span class="go">Series(TransferFunction(a*p**2 + b*s, -p + s, s), TransferFunction(s**3 - 2, s**4 + 5*s + 6, s))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf3</span><span class="p">,</span> <span class="o">-</span><span class="n">tf1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span>
<span class="go">Series(TransferFunction(s**3 - 2, s**4 + 5*s + 6, s), Parallel(TransferFunction(p**2, p + s, s), TransferFunction(-a*p**2 - b*s, -p + s, s)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S3</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">Parallel</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">),</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf3</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S3</span>
<span class="go">Series(Parallel(TransferFunction(a*p**2 + b*s, -p + s, s), TransferFunction(s**3 - 2, s**4 + 5*s + 6, s)), Parallel(TransferFunction(s**3 - 2, s**4 + 5*s + 6, s), TransferFunction(p**2, p + s, s)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S3</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
</pre></div>
</div>
<p>You can get the resultant transfer function by using <code class="docutils literal notranslate"><span class="pre">.doit()</span></code> method:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">S3</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">,</span> <span class="o">-</span><span class="n">tf3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S3</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction(-p**2*(s**3 - 2)*(a*p**2 + b*s), (-p + s)*(p + s)*(s**4 + 5*s + 6), s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S4</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="o">-</span><span class="n">tf3</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S4</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((s**3 - 2)*(-p**2*(-p + s) + (p + s)*(a*p**2 + b*s)), (-p + s)*(p + s)*(s**4 + 5*s + 6), s)</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>All the transfer functions should use the same complex variable
<code class="docutils literal notranslate"><span class="pre">var</span></code> of the Laplace transform.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.MIMOSeries" title="sympy.physics.control.lti.MIMOSeries"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MIMOSeries</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.Parallel" title="sympy.physics.control.lti.Parallel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Parallel</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.TransferFunction" title="sympy.physics.control.lti.TransferFunction"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TransferFunction</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.Feedback" title="sympy.physics.control.lti.Feedback"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Feedback</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Series.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L886-L909"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.Series.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the resultant transfer function obtained after evaluating
the transfer functions in series configuration.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Series</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((s**3 - 2)*(a*p**2 + b*s), (-p + s)*(s**4 + 5*s + 6), s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Series</span><span class="p">(</span><span class="o">-</span><span class="n">tf1</span><span class="p">,</span> <span class="o">-</span><span class="n">tf2</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((2 - s**3)*(-a*p**2 - b*s), (-p + s)*(s**4 + 5*s + 6), s)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Series.is_biproper">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_biproper</span></span><a class="headerlink" href="#sympy.physics.control.lti.Series.is_biproper" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if degree of the numerator polynomial of the resultant transfer
function is equal to degree of the denominator polynomial of
the same, else False.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="o">-</span><span class="n">tf2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span><span class="o">.</span><span class="n">is_biproper</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span><span class="o">.</span><span class="n">is_biproper</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Series.is_proper">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_proper</span></span><a class="headerlink" href="#sympy.physics.control.lti.Series.is_proper" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if degree of the numerator polynomial of the resultant transfer
function is less than or equal to degree of the denominator polynomial of
the same, else False.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">a</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="n">s</span><span class="p">,</span> <span class="n">b</span> <span class="o">-</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="o">-</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span><span class="o">.</span><span class="n">is_proper</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">,</span> <span class="n">tf3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span><span class="o">.</span><span class="n">is_proper</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Series.is_strictly_proper">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_strictly_proper</span></span><a class="headerlink" href="#sympy.physics.control.lti.Series.is_strictly_proper" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if degree of the numerator polynomial of the resultant transfer
function is strictly less than degree of the denominator polynomial of
the same, else False.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span><span class="o">.</span><span class="n">is_strictly_proper</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">,</span> <span class="n">tf3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span><span class="o">.</span><span class="n">is_strictly_proper</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Series.to_expr">
<span class="sig-name descname"><span class="pre">to_expr</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L960-L962"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.Series.to_expr" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the equivalent <code class="docutils literal notranslate"><span class="pre">Expr</span></code> object.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Series.var">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">var</span></span><a class="headerlink" href="#sympy.physics.control.lti.Series.var" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complex variable used by all the transfer functions.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Series</span><span class="p">,</span> <span class="n">Parallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">p</span> <span class="o">-</span> <span class="mi">6</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="mi">4</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Series</span><span class="p">(</span><span class="n">G1</span><span class="p">,</span> <span class="n">G2</span><span class="p">)</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Series</span><span class="p">(</span><span class="o">-</span><span class="n">G3</span><span class="p">,</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">G1</span><span class="p">,</span> <span class="n">G2</span><span class="p">))</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Parallel">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.control.lti.</span></span><span class="sig-name descname"><span class="pre">Parallel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evaluate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1242-L1471"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.Parallel" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing a parallel configuration of SISO systems.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>args</strong> : SISOLinearTimeInvariant</p>
<blockquote>
<div><p>SISO systems in a parallel arrangement.</p>
</div></blockquote>
<p><strong>evaluate</strong> : Boolean, Keyword</p>
<blockquote>
<div><p>When passed <code class="docutils literal notranslate"><span class="pre">True</span></code>, returns the equivalent
<code class="docutils literal notranslate"><span class="pre">Parallel(*args).doit()</span></code>. Set to <code class="docutils literal notranslate"><span class="pre">False</span></code> by default.</p>
</div></blockquote>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong></p>
<blockquote>
<div><p>When no argument is passed.</p>
<p><code class="docutils literal notranslate"><span class="pre">var</span></code> attribute is not same for every system.</p>
</div></blockquote>
<p><strong>TypeError</strong></p>
<blockquote>
<div><p>Any of the passed <code class="docutils literal notranslate"><span class="pre">*args</span></code> has unsupported type</p>
<p>A combination of SISO and MIMO systems is
passed. There should be homogeneity in the
type of systems passed.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Parallel</span><span class="p">,</span> <span class="n">Series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span> <span class="o">=</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span>
<span class="go">Parallel(TransferFunction(a*p**2 + b*s, -p + s, s), TransferFunction(s**3 - 2, s**4 + 5*s + 6, s))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span> <span class="o">=</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf3</span><span class="p">,</span> <span class="o">-</span><span class="n">tf1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span>
<span class="go">Parallel(TransferFunction(s**3 - 2, s**4 + 5*s + 6, s), Series(TransferFunction(p**2, p + s, s), TransferFunction(-a*p**2 - b*s, -p + s, s)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P3</span> <span class="o">=</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">Series</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">),</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf3</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P3</span>
<span class="go">Parallel(Series(TransferFunction(a*p**2 + b*s, -p + s, s), TransferFunction(s**3 - 2, s**4 + 5*s + 6, s)), Series(TransferFunction(s**3 - 2, s**4 + 5*s + 6, s), TransferFunction(p**2, p + s, s)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P3</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
</pre></div>
</div>
<p>You can get the resultant transfer function by using <code class="docutils literal notranslate"><span class="pre">.doit()</span></code> method:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Parallel</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">,</span> <span class="o">-</span><span class="n">tf3</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction(-p**2*(-p + s)*(s**4 + 5*s + 6) + (-p + s)*(p + s)*(s**3 - 2) + (p + s)*(a*p**2 + b*s)*(s**4 + 5*s + 6), (-p + s)*(p + s)*(s**4 + 5*s + 6), s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Parallel</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">Series</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="o">-</span><span class="n">tf3</span><span class="p">))</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction(-p**2*(a*p**2 + b*s)*(s**4 + 5*s + 6) + (-p + s)*(p + s)*(s**3 - 2), (-p + s)*(p + s)*(s**4 + 5*s + 6), s)</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>All the transfer functions should use the same complex variable
<code class="docutils literal notranslate"><span class="pre">var</span></code> of the Laplace transform.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.Series" title="sympy.physics.control.lti.Series"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Series</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.TransferFunction" title="sympy.physics.control.lti.TransferFunction"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TransferFunction</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.Feedback" title="sympy.physics.control.lti.Feedback"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Feedback</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Parallel.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1341-L1362"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.Parallel.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the resultant transfer function obtained after evaluating
the transfer functions in parallel configuration.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Parallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Parallel</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((-p + s)*(s**3 - 2) + (a*p**2 + b*s)*(s**4 + 5*s + 6), (-p + s)*(s**4 + 5*s + 6), s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Parallel</span><span class="p">(</span><span class="o">-</span><span class="n">tf1</span><span class="p">,</span> <span class="o">-</span><span class="n">tf2</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((2 - s**3)*(-p + s) + (-a*p**2 - b*s)*(s**4 + 5*s + 6), (-p + s)*(s**4 + 5*s + 6), s)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Parallel.is_biproper">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_biproper</span></span><a class="headerlink" href="#sympy.physics.control.lti.Parallel.is_biproper" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if degree of the numerator polynomial of the resultant transfer
function is equal to degree of the denominator polynomial of
the same, else False.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Parallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span> <span class="o">=</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="o">-</span><span class="n">tf2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span><span class="o">.</span><span class="n">is_biproper</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span> <span class="o">=</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span><span class="o">.</span><span class="n">is_biproper</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Parallel.is_proper">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_proper</span></span><a class="headerlink" href="#sympy.physics.control.lti.Parallel.is_proper" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if degree of the numerator polynomial of the resultant transfer
function is less than or equal to degree of the denominator polynomial of
the same, else False.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Parallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">a</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="n">s</span><span class="p">,</span> <span class="n">b</span> <span class="o">-</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span> <span class="o">=</span> <span class="n">Parallel</span><span class="p">(</span><span class="o">-</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span><span class="o">.</span><span class="n">is_proper</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span> <span class="o">=</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span><span class="o">.</span><span class="n">is_proper</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Parallel.is_strictly_proper">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_strictly_proper</span></span><a class="headerlink" href="#sympy.physics.control.lti.Parallel.is_strictly_proper" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if degree of the numerator polynomial of the resultant transfer
function is strictly less than degree of the denominator polynomial of
the same, else False.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Parallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span> <span class="o">=</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span><span class="o">.</span><span class="n">is_strictly_proper</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span> <span class="o">=</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span><span class="o">.</span><span class="n">is_strictly_proper</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Parallel.to_expr">
<span class="sig-name descname"><span class="pre">to_expr</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1394-L1396"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.Parallel.to_expr" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the equivalent <code class="docutils literal notranslate"><span class="pre">Expr</span></code> object.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Parallel.var">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">var</span></span><a class="headerlink" href="#sympy.physics.control.lti.Parallel.var" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complex variable used by all the transfer functions.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Parallel</span><span class="p">,</span> <span class="n">Series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">p</span> <span class="o">-</span> <span class="mi">6</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="mi">4</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Parallel</span><span class="p">(</span><span class="n">G1</span><span class="p">,</span> <span class="n">G2</span><span class="p">)</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Parallel</span><span class="p">(</span><span class="o">-</span><span class="n">G3</span><span class="p">,</span> <span class="n">Series</span><span class="p">(</span><span class="n">G1</span><span class="p">,</span> <span class="n">G2</span><span class="p">))</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Feedback">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.control.lti.</span></span><span class="sig-name descname"><span class="pre">Feedback</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sys1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sys2</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sign</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1659-L1931"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.Feedback" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing closed-loop feedback interconnection between two
SISO input/output systems.</p>
<p>The first argument, <code class="docutils literal notranslate"><span class="pre">sys1</span></code>, is the feedforward part of the closed-loop
system or in simple words, the dynamical model representing the process
to be controlled. The second argument, <code class="docutils literal notranslate"><span class="pre">sys2</span></code>, is the feedback system
and controls the fed back signal to <code class="docutils literal notranslate"><span class="pre">sys1</span></code>. Both <code class="docutils literal notranslate"><span class="pre">sys1</span></code> and <code class="docutils literal notranslate"><span class="pre">sys2</span></code>
can either be <code class="docutils literal notranslate"><span class="pre">Series</span></code> or <code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code> objects.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>sys1</strong> : Series, TransferFunction</p>
<blockquote>
<div><p>The feedforward path system.</p>
</div></blockquote>
<p><strong>sys2</strong> : Series, TransferFunction, optional</p>
<blockquote>
<div><p>The feedback path system (often a feedback controller).
It is the model sitting on the feedback path.</p>
<p>If not specified explicitly, the sys2 is
assumed to be unit (1.0) transfer function.</p>
</div></blockquote>
<p><strong>sign</strong> : int, optional</p>
<blockquote>
<div><p>The sign of feedback. Can either be <code class="docutils literal notranslate"><span class="pre">1</span></code>
(for positive feedback) or <code class="docutils literal notranslate"><span class="pre">-1</span></code> (for negative feedback).
Default value is <span class="math notranslate nohighlight">\(-1\)</span>.</p>
</div></blockquote>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong></p>
<blockquote>
<div><p>When <code class="docutils literal notranslate"><span class="pre">sys1</span></code> and <code class="docutils literal notranslate"><span class="pre">sys2</span></code> are not using the
same complex variable of the Laplace transform.</p>
<p>When a combination of <code class="docutils literal notranslate"><span class="pre">sys1</span></code> and <code class="docutils literal notranslate"><span class="pre">sys2</span></code> yields
zero denominator.</p>
</div></blockquote>
<p><strong>TypeError</strong></p>
<blockquote>
<div><p>When either <code class="docutils literal notranslate"><span class="pre">sys1</span></code> or <code class="docutils literal notranslate"><span class="pre">sys2</span></code> is not a <code class="docutils literal notranslate"><span class="pre">Series</span></code> or a
<code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code> object.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plant</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">7</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">controller</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">10</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">7</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">plant</span><span class="p">,</span> <span class="n">controller</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span>
<span class="go">Feedback(TransferFunction(3*s**2 + 7*s - 3, s**2 - 4*s + 2, s), TransferFunction(5*s - 10, s + 7, s), -1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span><span class="o">.</span><span class="n">args</span>
<span class="go">(TransferFunction(3*s**2 + 7*s - 3, s**2 - 4*s + 2, s), TransferFunction(5*s - 10, s + 7, s), -1)</span>
</pre></div>
</div>
<p>You can get the feedforward and feedback path systems by using <code class="docutils literal notranslate"><span class="pre">.sys1</span></code> and <code class="docutils literal notranslate"><span class="pre">.sys2</span></code> respectively.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span><span class="o">.</span><span class="n">sys1</span>
<span class="go">TransferFunction(3*s**2 + 7*s - 3, s**2 - 4*s + 2, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span><span class="o">.</span><span class="n">sys2</span>
<span class="go">TransferFunction(5*s - 10, s + 7, s)</span>
</pre></div>
</div>
<p>You can get the resultant closed loop transfer function obtained by negative feedback
interconnection using <code class="docutils literal notranslate"><span class="pre">.doit()</span></code> method.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((s + 7)*(s**2 - 4*s + 2)*(3*s**2 + 7*s - 3), ((s + 7)*(s**2 - 4*s + 2) + (5*s - 10)*(3*s**2 + 7*s - 3))*(s**2 - 4*s + 2), s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">G</span><span class="o">*</span><span class="n">C</span><span class="p">,</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((s + 10)*(5*s + 10)*(s**2 + 2*s + 3)*(2*s**2 + 5*s + 1), (s + 10)*((s + 10)*(s**2 + 2*s + 3) + (5*s + 10)*(2*s**2 + 5*s + 1))*(s**2 + 2*s + 3), s)</span>
</pre></div>
</div>
<p>To negate a <code class="docutils literal notranslate"><span class="pre">Feedback</span></code> object, the <code class="docutils literal notranslate"><span class="pre">-</span></code> operator can be prepended:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="o">-</span><span class="n">F1</span>
<span class="go">Feedback(TransferFunction(-3*s**2 - 7*s + 3, s**2 - 4*s + 2, s), TransferFunction(10 - 5*s, s + 7, s), -1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="o">-</span><span class="n">F2</span>
<span class="go">Feedback(Series(TransferFunction(-1, 1, s), TransferFunction(2*s**2 + 5*s + 1, s**2 + 2*s + 3, s), TransferFunction(5*s + 10, s + 10, s)), TransferFunction(-1, 1, s), -1)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.MIMOFeedback" title="sympy.physics.control.lti.MIMOFeedback"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MIMOFeedback</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.Series" title="sympy.physics.control.lti.Series"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Series</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.Parallel" title="sympy.physics.control.lti.Parallel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Parallel</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Feedback.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cancel</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expand</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1879-L1925"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.Feedback.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the resultant transfer function obtained by the
feedback interconnection.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plant</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">7</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">controller</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">10</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">7</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">plant</span><span class="p">,</span> <span class="n">controller</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((s + 7)*(s**2 - 4*s + 2)*(3*s**2 + 7*s - 3), ((s + 7)*(s**2 - 4*s + 2) + (5*s - 10)*(3*s**2 + 7*s - 3))*(s**2 - 4*s + 2), s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">G</span><span class="p">,</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunction((s**2 + 2*s + 3)*(2*s**2 + 5*s + 1), (s**2 + 2*s + 3)*(3*s**2 + 7*s + 4), s)</span>
</pre></div>
</div>
<p>Use kwarg <code class="docutils literal notranslate"><span class="pre">expand=True</span></code> to expand the resultant transfer function.
Use <code class="docutils literal notranslate"><span class="pre">cancel=True</span></code> to cancel out the common terms in numerator and
denominator.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span><span class="o">.</span><span class="n">doit</span><span class="p">(</span><span class="n">cancel</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">expand</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">TransferFunction(2*s**2 + 5*s + 1, 3*s**2 + 7*s + 4, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span><span class="o">.</span><span class="n">doit</span><span class="p">(</span><span class="n">expand</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">TransferFunction(2*s**4 + 9*s**3 + 17*s**2 + 17*s + 3, 3*s**4 + 13*s**3 + 27*s**2 + 29*s + 12, s)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Feedback.sensitivity">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">sensitivity</span></span><a class="headerlink" href="#sympy.physics.control.lti.Feedback.sensitivity" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the sensitivity function of the feedback loop.</p>
<p>Sensitivity of a Feedback system is the ratio
of change in the open loop gain to the change in
the closed loop gain.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This method would not return the complementary
sensitivity function.</p>
</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">P</span><span class="p">,</span> <span class="n">C</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span><span class="o">.</span><span class="n">sensitivity</span>
<span class="go">1/((1 - p)*(5*p + 10)/((p + 2)*(p + 10)) + 1)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Feedback.sign">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">sign</span></span><a class="headerlink" href="#sympy.physics.control.lti.Feedback.sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the type of MIMO Feedback model. <code class="docutils literal notranslate"><span class="pre">1</span></code>
for Positive and <code class="docutils literal notranslate"><span class="pre">-1</span></code> for Negative.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Feedback.sys1">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">sys1</span></span><a class="headerlink" href="#sympy.physics.control.lti.Feedback.sys1" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the feedforward system of the feedback interconnection.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plant</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">7</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">controller</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">10</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">7</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">plant</span><span class="p">,</span> <span class="n">controller</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span><span class="o">.</span><span class="n">sys1</span>
<span class="go">TransferFunction(3*s**2 + 7*s - 3, s**2 - 4*s + 2, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">),</span> <span class="n">G</span><span class="o">*</span><span class="n">C</span><span class="o">*</span><span class="n">P</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span><span class="o">.</span><span class="n">sys1</span>
<span class="go">TransferFunction(1, 1, p)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Feedback.sys2">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">sys2</span></span><a class="headerlink" href="#sympy.physics.control.lti.Feedback.sys2" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the feedback controller of the feedback interconnection.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plant</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">7</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">controller</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">10</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">7</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">plant</span><span class="p">,</span> <span class="n">controller</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span><span class="o">.</span><span class="n">sys2</span>
<span class="go">TransferFunction(5*s - 10, s + 7, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">),</span> <span class="n">G</span><span class="o">*</span><span class="n">C</span><span class="o">*</span><span class="n">P</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span><span class="o">.</span><span class="n">sys2</span>
<span class="go">Series(TransferFunction(2*s**2 + 5*s + 1, p**2 + 2*p + 3, p), TransferFunction(5*p + 10, p + 10, p), TransferFunction(1 - s, p + 2, p))</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.Feedback.var">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">var</span></span><a class="headerlink" href="#sympy.physics.control.lti.Feedback.var" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complex variable of the Laplace transform used by all
the transfer functions involved in the feedback interconnection.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">Feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plant</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">7</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">4</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">controller</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">10</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">7</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">plant</span><span class="p">,</span> <span class="n">controller</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F1</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="mi">10</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span> <span class="o">=</span> <span class="n">Feedback</span><span class="p">(</span><span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">),</span> <span class="n">G</span><span class="o">*</span><span class="n">C</span><span class="o">*</span><span class="n">P</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F2</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.control.lti.</span></span><span class="sig-name descname"><span class="pre">TransferFunctionMatrix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L2299-L2936"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing the MIMO (multiple-input and multiple-output)
generalization of the SISO (single-input and single-output) transfer function.</p>
<p>It is a matrix of transfer functions (<code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code>, SISO-<code class="docutils literal notranslate"><span class="pre">Series</span></code> or SISO-<code class="docutils literal notranslate"><span class="pre">Parallel</span></code>).
There is only one argument, <code class="docutils literal notranslate"><span class="pre">arg</span></code> which is also the compulsory argument.
<code class="docutils literal notranslate"><span class="pre">arg</span></code> is expected to be strictly of the type list of lists
which holds the transfer functions or reducible to transfer functions.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : Nested <code class="docutils literal notranslate"><span class="pre">List</span></code> (strictly).</p>
<blockquote>
<div><p>Users are expected to input a nested list of <code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code>, <code class="docutils literal notranslate"><span class="pre">Series</span></code>
and/or <code class="docutils literal notranslate"><span class="pre">Parallel</span></code> objects.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><code class="docutils literal notranslate"><span class="pre">pprint()</span></code> can be used for better visualization of <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code> objects.</p>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">Series</span><span class="p">,</span> <span class="n">Parallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="n">a</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">3</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_4</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="o">-</span><span class="n">a</span> <span class="o">+</span> <span class="n">p</span><span class="p">,</span> <span class="mi">9</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">9</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_1</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_3</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(a + s, s**2 + s + 1, s),), (TransferFunction(p**4 - 3*p + 2, p + s, s),), (TransferFunction(3, s + 2, s),)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span><span class="o">.</span><span class="n">num_inputs</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span><span class="o">.</span><span class="n">num_outputs</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(3, 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span><span class="o">.</span><span class="n">args</span>
<span class="go">(((TransferFunction(a + s, s**2 + s + 1, s),), (TransferFunction(p**4 - 3*p + 2, p + s, s),), (TransferFunction(3, s + 2, s),)),)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_1</span><span class="p">,</span> <span class="o">-</span><span class="n">tf_3</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_2</span><span class="p">,</span> <span class="o">-</span><span class="n">tf_1</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_3</span><span class="p">,</span> <span class="o">-</span><span class="n">tf_2</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_2</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(a + s, s**2 + s + 1, s), TransferFunction(-3, s + 2, s)), (TransferFunction(p**4 - 3*p + 2, p + s, s), TransferFunction(-a - s, s**2 + s + 1, s)), (TransferFunction(3, s + 2, s), TransferFunction(-p**4 + 3*p - 2, p + s, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">tfm_2</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>  <span class="c1"># pretty-printing for better visualization</span>
<span class="go">[   a + s           -3       ]</span>
<span class="go">[ ----------       -----     ]</span>
<span class="go">[  2               s + 2     ]</span>
<span class="go">[ s  + s + 1                 ]</span>
<span class="go">[                            ]</span>
<span class="go">[ 4                          ]</span>
<span class="go">[p  - 3*p + 2      -a - s    ]</span>
<span class="go">[------------    ----------  ]</span>
<span class="go">[   p + s         2          ]</span>
<span class="go">[                s  + s + 1  ]</span>
<span class="go">[                            ]</span>
<span class="go">[                 4          ]</span>
<span class="go">[     3        - p  + 3*p - 2]</span>
<span class="go">[   -----      --------------]</span>
<span class="go">[   s + 2          p + s     ]{t}</span>
</pre></div>
</div>
<p>TransferFunctionMatrix can be transposed, if user wants to switch the input and output transfer functions</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_2</span><span class="o">.</span><span class="n">transpose</span><span class="p">()</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(a + s, s**2 + s + 1, s), TransferFunction(p**4 - 3*p + 2, p + s, s), TransferFunction(3, s + 2, s)), (TransferFunction(-3, s + 2, s), TransferFunction(-a - s, s**2 + s + 1, s), TransferFunction(-p**4 + 3*p - 2, p + s, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[             4                          ]</span>
<span class="go">[  a + s     p  - 3*p + 2        3       ]</span>
<span class="go">[----------  ------------      -----     ]</span>
<span class="go">[ 2             p + s          s + 2     ]</span>
<span class="go">[s  + s + 1                              ]</span>
<span class="go">[                                        ]</span>
<span class="go">[                             4          ]</span>
<span class="go">[   -3          -a - s     - p  + 3*p - 2]</span>
<span class="go">[  -----      ----------   --------------]</span>
<span class="go">[  s + 2       2               p + s     ]</span>
<span class="go">[             s  + s + 1                 ]{t}</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tf_5</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_6</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="p">(</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_7</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span><span class="o">*</span><span class="p">(</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">)),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_8</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_5</span><span class="p">,</span> <span class="n">tf_6</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_7</span><span class="p">,</span> <span class="n">tf_8</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(5, s, s), TransferFunction(5*s, s**2 + 2, s)), (TransferFunction(5, s*(s**2 + 2), s), TransferFunction(5, 1, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">tfm_3</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[    5        5*s  ]</span>
<span class="go">[    -       ------]</span>
<span class="go">[    s        2    ]</span>
<span class="go">[            s  + 2]</span>
<span class="go">[                  ]</span>
<span class="go">[    5         5   ]</span>
<span class="go">[----------    -   ]</span>
<span class="go">[  / 2    \    1   ]</span>
<span class="go">[s*\s  + 2/        ]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(2, 2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span><span class="o">.</span><span class="n">num_outputs</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span><span class="o">.</span><span class="n">num_inputs</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span><span class="o">.</span><span class="n">args</span>
<span class="go">(((TransferFunction(5, s, s), TransferFunction(5*s, s**2 + 2, s)), (TransferFunction(5, s*(s**2 + 2), s), TransferFunction(5, 1, s))),)</span>
</pre></div>
</div>
<p>To access the <code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code> at any index in the <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code>, use the index notation.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>  <span class="c1"># gives the TransferFunction present at 2nd Row and 1st Col. Similar to that in Matrix classes</span>
<span class="go">TransferFunction(5, s*(s**2 + 2), s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>  <span class="c1"># gives the TransferFunction present at 1st Row and 1st Col.</span>
<span class="go">TransferFunction(5, s, s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span>  <span class="c1"># gives the first column</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(5, s, s),), (TransferFunction(5, s*(s**2 + 2), s),)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[    5     ]</span>
<span class="go">[    -     ]</span>
<span class="go">[    s     ]</span>
<span class="go">[          ]</span>
<span class="go">[    5     ]</span>
<span class="go">[----------]</span>
<span class="go">[  / 2    \]</span>
<span class="go">[s*\s  + 2/]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_3</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="p">:]</span>  <span class="c1"># gives the first row</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(5, s, s), TransferFunction(5*s, s**2 + 2, s)),))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[5   5*s  ]</span>
<span class="go">[-  ------]</span>
<span class="go">[s   2    ]</span>
<span class="go">[   s  + 2]{t}</span>
</pre></div>
</div>
<p>To negate a transfer function matrix, <code class="docutils literal notranslate"><span class="pre">-</span></code> operator can be prepended:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_4</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_2</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="n">tf_1</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_3</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="o">-</span><span class="n">tfm_4</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(-p**4 + 3*p - 2, p + s, s),), (TransferFunction(a + s, s**2 + s + 1, s),), (TransferFunction(-3, s + 2, s),)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_5</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_1</span><span class="p">,</span> <span class="n">tf_2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_3</span><span class="p">,</span> <span class="o">-</span><span class="n">tf_1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="o">-</span><span class="n">tfm_5</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(-a - s, s**2 + s + 1, s), TransferFunction(-p**4 + 3*p - 2, p + s, s)), (TransferFunction(-3, s + 2, s), TransferFunction(a + s, s**2 + s + 1, s))))</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">subs()</span></code> returns the <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code> object with the value substituted in the expression. This will not
mutate your original <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_2</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>  <span class="c1">#  substituting p everywhere in tfm_2 with 2.</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(a + s, s**2 + s + 1, s), TransferFunction(-3, s + 2, s)), (TransferFunction(12, s + 2, s), TransferFunction(-a - s, s**2 + s + 1, s)), (TransferFunction(3, s + 2, s), TransferFunction(-12, s + 2, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[  a + s        -3     ]</span>
<span class="go">[----------    -----   ]</span>
<span class="go">[ 2            s + 2   ]</span>
<span class="go">[s  + s + 1            ]</span>
<span class="go">[                      ]</span>
<span class="go">[    12        -a - s  ]</span>
<span class="go">[  -----     ----------]</span>
<span class="go">[  s + 2      2        ]</span>
<span class="go">[            s  + s + 1]</span>
<span class="go">[                      ]</span>
<span class="go">[    3          -12    ]</span>
<span class="go">[  -----       -----   ]</span>
<span class="go">[  s + 2       s + 2   ]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">tfm_2</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> <span class="c1"># State of tfm_2 is unchanged after substitution</span>
<span class="go">[   a + s           -3       ]</span>
<span class="go">[ ----------       -----     ]</span>
<span class="go">[  2               s + 2     ]</span>
<span class="go">[ s  + s + 1                 ]</span>
<span class="go">[                            ]</span>
<span class="go">[ 4                          ]</span>
<span class="go">[p  - 3*p + 2      -a - s    ]</span>
<span class="go">[------------    ----------  ]</span>
<span class="go">[   p + s         2          ]</span>
<span class="go">[                s  + s + 1  ]</span>
<span class="go">[                            ]</span>
<span class="go">[                 4          ]</span>
<span class="go">[     3        - p  + 3*p - 2]</span>
<span class="go">[   -----      --------------]</span>
<span class="go">[   s + 2          p + s     ]{t}</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">subs()</span></code> also supports multiple substitutions.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_2</span><span class="o">.</span><span class="n">subs</span><span class="p">({</span><span class="n">p</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span> <span class="n">a</span><span class="p">:</span> <span class="mi">1</span><span class="p">})</span>  <span class="c1"># substituting p with 2 and a with 1</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(s + 1, s**2 + s + 1, s), TransferFunction(-3, s + 2, s)), (TransferFunction(12, s + 2, s), TransferFunction(-s - 1, s**2 + s + 1, s)), (TransferFunction(3, s + 2, s), TransferFunction(-12, s + 2, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[  s + 1        -3     ]</span>
<span class="go">[----------    -----   ]</span>
<span class="go">[ 2            s + 2   ]</span>
<span class="go">[s  + s + 1            ]</span>
<span class="go">[                      ]</span>
<span class="go">[    12        -s - 1  ]</span>
<span class="go">[  -----     ----------]</span>
<span class="go">[  s + 2      2        ]</span>
<span class="go">[            s  + s + 1]</span>
<span class="go">[                      ]</span>
<span class="go">[    3          -12    ]</span>
<span class="go">[  -----       -----   ]</span>
<span class="go">[  s + 2       s + 2   ]{t}</span>
</pre></div>
</div>
<p>Users can reduce the <code class="docutils literal notranslate"><span class="pre">Series</span></code> and <code class="docutils literal notranslate"><span class="pre">Parallel</span></code> elements of the matrix to <code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code> by using
<code class="docutils literal notranslate"><span class="pre">doit()</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_6</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">Series</span><span class="p">(</span><span class="n">tf_3</span><span class="p">,</span> <span class="n">tf_4</span><span class="p">),</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf_3</span><span class="p">,</span> <span class="n">tf_4</span><span class="p">)]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_6</span>
<span class="go">TransferFunctionMatrix(((Series(TransferFunction(3, s + 2, s), TransferFunction(-a + p, 9*s - 9, s)), Parallel(TransferFunction(3, s + 2, s), TransferFunction(-a + p, 9*s - 9, s))),))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">tfm_6</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[ -a + p   3     -a + p     3  ]</span>
<span class="go">[-------*-----  ------- + -----]</span>
<span class="go">[9*s - 9 s + 2  9*s - 9   s + 2]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_6</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(-3*a + 3*p, (s + 2)*(9*s - 9), s), TransferFunction(27*s + (-a + p)*(s + 2) - 27, (s + 2)*(9*s - 9), s)),))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[    -3*a + 3*p     27*s + (-a + p)*(s + 2) - 27]</span>
<span class="go">[-----------------  ----------------------------]</span>
<span class="go">[(s + 2)*(9*s - 9)       (s + 2)*(9*s - 9)      ]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_9</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_10</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_7</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">Series</span><span class="p">(</span><span class="n">tf_9</span><span class="p">,</span> <span class="n">tf_10</span><span class="p">),</span> <span class="n">tf_9</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_10</span><span class="p">,</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">tf_9</span><span class="p">,</span> <span class="n">tf_10</span><span class="p">)]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_7</span>
<span class="go">TransferFunctionMatrix(((Series(TransferFunction(1, s, s), TransferFunction(1, s**2, s)), TransferFunction(1, s, s)), (TransferFunction(1, s**2, s), Parallel(TransferFunction(1, s, s), TransferFunction(1, s**2, s)))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">tfm_7</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[ 1      1   ]</span>
<span class="go">[----    -   ]</span>
<span class="go">[   2    s   ]</span>
<span class="go">[s*s         ]</span>
<span class="go">[            ]</span>
<span class="go">[ 1    1    1]</span>
<span class="go">[ --   -- + -]</span>
<span class="go">[  2    2   s]</span>
<span class="go">[ s    s     ]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_7</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(1, s**3, s), TransferFunction(1, s, s)), (TransferFunction(1, s**2, s), TransferFunction(s**2 + s, s**3, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[1     1   ]</span>
<span class="go">[--    -   ]</span>
<span class="go">[ 3    s   ]</span>
<span class="go">[s         ]</span>
<span class="go">[          ]</span>
<span class="go">[     2    ]</span>
<span class="go">[1   s  + s]</span>
<span class="go">[--  ------]</span>
<span class="go">[ 2     3  ]</span>
<span class="go">[s     s   ]{t}</span>
</pre></div>
</div>
<p>Addition, subtraction, and multiplication of transfer function matrices can form
unevaluated <code class="docutils literal notranslate"><span class="pre">Series</span></code> or <code class="docutils literal notranslate"><span class="pre">Parallel</span></code> objects.</p>
<ul class="simple">
<li><p>For addition and subtraction:
All the transfer function matrices must have the same shape.</p></li>
<li><p>For multiplication (C = A * B):
The number of inputs of the first transfer function matrix (A) must be equal to the
number of outputs of the second transfer function matrix (B).</p></li>
</ul>
<p>Also, use pretty-printing (<code class="docutils literal notranslate"><span class="pre">pprint</span></code>) to analyse better.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_8</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_3</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_2</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="n">tf_1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_9</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="o">-</span><span class="n">tf_3</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_10</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_1</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_4</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_11</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_4</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="n">tf_1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_12</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_4</span><span class="p">,</span> <span class="o">-</span><span class="n">tf_1</span><span class="p">,</span> <span class="n">tf_3</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="n">tf_2</span><span class="p">,</span> <span class="o">-</span><span class="n">tf_4</span><span class="p">,</span> <span class="o">-</span><span class="n">tf_3</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_8</span> <span class="o">+</span> <span class="n">tfm_10</span>
<span class="go">MIMOParallel(TransferFunctionMatrix(((TransferFunction(3, s + 2, s),), (TransferFunction(p**4 - 3*p + 2, p + s, s),), (TransferFunction(-a - s, s**2 + s + 1, s),))), TransferFunctionMatrix(((TransferFunction(a + s, s**2 + s + 1, s),), (TransferFunction(p**4 - 3*p + 2, p + s, s),), (TransferFunction(-a + p, 9*s - 9, s),))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[     3      ]      [   a + s    ]</span>
<span class="go">[   -----    ]      [ ---------- ]</span>
<span class="go">[   s + 2    ]      [  2         ]</span>
<span class="go">[            ]      [ s  + s + 1 ]</span>
<span class="go">[ 4          ]      [            ]</span>
<span class="go">[p  - 3*p + 2]      [ 4          ]</span>
<span class="go">[------------]    + [p  - 3*p + 2]</span>
<span class="go">[   p + s    ]      [------------]</span>
<span class="go">[            ]      [   p + s    ]</span>
<span class="go">[   -a - s   ]      [            ]</span>
<span class="go">[ ---------- ]      [   -a + p   ]</span>
<span class="go">[  2         ]      [  -------   ]</span>
<span class="go">[ s  + s + 1 ]{t}   [  9*s - 9   ]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="o">-</span><span class="n">tfm_10</span> <span class="o">-</span> <span class="n">tfm_8</span>
<span class="go">MIMOParallel(TransferFunctionMatrix(((TransferFunction(-a - s, s**2 + s + 1, s),), (TransferFunction(-p**4 + 3*p - 2, p + s, s),), (TransferFunction(a - p, 9*s - 9, s),))), TransferFunctionMatrix(((TransferFunction(-3, s + 2, s),), (TransferFunction(-p**4 + 3*p - 2, p + s, s),), (TransferFunction(a + s, s**2 + s + 1, s),))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[    -a - s    ]      [     -3       ]</span>
<span class="go">[  ----------  ]      [    -----     ]</span>
<span class="go">[   2          ]      [    s + 2     ]</span>
<span class="go">[  s  + s + 1  ]      [              ]</span>
<span class="go">[              ]      [   4          ]</span>
<span class="go">[   4          ]      [- p  + 3*p - 2]</span>
<span class="go">[- p  + 3*p - 2]    + [--------------]</span>
<span class="go">[--------------]      [    p + s     ]</span>
<span class="go">[    p + s     ]      [              ]</span>
<span class="go">[              ]      [    a + s     ]</span>
<span class="go">[    a - p     ]      [  ----------  ]</span>
<span class="go">[   -------    ]      [   2          ]</span>
<span class="go">[   9*s - 9    ]{t}   [  s  + s + 1  ]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_12</span> <span class="o">*</span> <span class="n">tfm_8</span>
<span class="go">MIMOSeries(TransferFunctionMatrix(((TransferFunction(3, s + 2, s),), (TransferFunction(p**4 - 3*p + 2, p + s, s),), (TransferFunction(-a - s, s**2 + s + 1, s),))), TransferFunctionMatrix(((TransferFunction(-a + p, 9*s - 9, s), TransferFunction(-a - s, s**2 + s + 1, s), TransferFunction(3, s + 2, s)), (TransferFunction(-p**4 + 3*p - 2, p + s, s), TransferFunction(a - p, 9*s - 9, s), TransferFunction(-3, s + 2, s)))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">                                       [     3      ]</span>
<span class="go">                                       [   -----    ]</span>
<span class="go">[    -a + p        -a - s      3  ]    [   s + 2    ]</span>
<span class="go">[   -------      ----------  -----]    [            ]</span>
<span class="go">[   9*s - 9       2          s + 2]    [ 4          ]</span>
<span class="go">[                s  + s + 1       ]    [p  - 3*p + 2]</span>
<span class="go">[                                 ]   *[------------]</span>
<span class="go">[   4                             ]    [   p + s    ]</span>
<span class="go">[- p  + 3*p - 2    a - p      -3  ]    [            ]</span>
<span class="go">[--------------   -------    -----]    [   -a - s   ]</span>
<span class="go">[    p + s        9*s - 9    s + 2]{t} [ ---------- ]</span>
<span class="go">                                       [  2         ]</span>
<span class="go">                                       [ s  + s + 1 ]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_12</span> <span class="o">*</span> <span class="n">tfm_8</span> <span class="o">*</span> <span class="n">tfm_9</span>
<span class="go">MIMOSeries(TransferFunctionMatrix(((TransferFunction(-3, s + 2, s),),)), TransferFunctionMatrix(((TransferFunction(3, s + 2, s),), (TransferFunction(p**4 - 3*p + 2, p + s, s),), (TransferFunction(-a - s, s**2 + s + 1, s),))), TransferFunctionMatrix(((TransferFunction(-a + p, 9*s - 9, s), TransferFunction(-a - s, s**2 + s + 1, s), TransferFunction(3, s + 2, s)), (TransferFunction(-p**4 + 3*p - 2, p + s, s), TransferFunction(a - p, 9*s - 9, s), TransferFunction(-3, s + 2, s)))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">                                       [     3      ]</span>
<span class="go">                                       [   -----    ]</span>
<span class="go">[    -a + p        -a - s      3  ]    [   s + 2    ]</span>
<span class="go">[   -------      ----------  -----]    [            ]</span>
<span class="go">[   9*s - 9       2          s + 2]    [ 4          ]</span>
<span class="go">[                s  + s + 1       ]    [p  - 3*p + 2]    [ -3  ]</span>
<span class="go">[                                 ]   *[------------]   *[-----]</span>
<span class="go">[   4                             ]    [   p + s    ]    [s + 2]{t}</span>
<span class="go">[- p  + 3*p - 2    a - p      -3  ]    [            ]</span>
<span class="go">[--------------   -------    -----]    [   -a - s   ]</span>
<span class="go">[    p + s        9*s - 9    s + 2]{t} [ ---------- ]</span>
<span class="go">                                       [  2         ]</span>
<span class="go">                                       [ s  + s + 1 ]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_10</span> <span class="o">+</span> <span class="n">tfm_8</span><span class="o">*</span><span class="n">tfm_9</span>
<span class="go">MIMOParallel(TransferFunctionMatrix(((TransferFunction(a + s, s**2 + s + 1, s),), (TransferFunction(p**4 - 3*p + 2, p + s, s),), (TransferFunction(-a + p, 9*s - 9, s),))), MIMOSeries(TransferFunctionMatrix(((TransferFunction(-3, s + 2, s),),)), TransferFunctionMatrix(((TransferFunction(3, s + 2, s),), (TransferFunction(p**4 - 3*p + 2, p + s, s),), (TransferFunction(-a - s, s**2 + s + 1, s),)))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[   a + s    ]      [     3      ]</span>
<span class="go">[ ---------- ]      [   -----    ]</span>
<span class="go">[  2         ]      [   s + 2    ]</span>
<span class="go">[ s  + s + 1 ]      [            ]</span>
<span class="go">[            ]      [ 4          ]</span>
<span class="go">[ 4          ]      [p  - 3*p + 2]    [ -3  ]</span>
<span class="go">[p  - 3*p + 2]    + [------------]   *[-----]</span>
<span class="go">[------------]      [   p + s    ]    [s + 2]{t}</span>
<span class="go">[   p + s    ]      [            ]</span>
<span class="go">[            ]      [   -a - s   ]</span>
<span class="go">[   -a + p   ]      [ ---------- ]</span>
<span class="go">[  -------   ]      [  2         ]</span>
<span class="go">[  9*s - 9   ]{t}   [ s  + s + 1 ]{t}</span>
</pre></div>
</div>
<p>These unevaluated <code class="docutils literal notranslate"><span class="pre">Series</span></code> or <code class="docutils literal notranslate"><span class="pre">Parallel</span></code> objects can convert into the
resultant transfer function matrix using <code class="docutils literal notranslate"><span class="pre">.doit()</span></code> method or by
<code class="docutils literal notranslate"><span class="pre">.rewrite(TransferFunctionMatrix)</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="o">-</span><span class="n">tfm_8</span> <span class="o">+</span> <span class="n">tfm_10</span> <span class="o">+</span> <span class="n">tfm_8</span><span class="o">*</span><span class="n">tfm_9</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunctionMatrix(((TransferFunction((a + s)*(s + 2)**3 - 3*(s + 2)**2*(s**2 + s + 1) - 9*(s + 2)*(s**2 + s + 1), (s + 2)**3*(s**2 + s + 1), s),), (TransferFunction((p + s)*(-3*p**4 + 9*p - 6), (p + s)**2*(s + 2), s),), (TransferFunction((-a + p)*(s + 2)*(s**2 + s + 1)**2 + (a + s)*(s + 2)*(9*s - 9)*(s**2 + s + 1) + (3*a + 3*s)*(9*s - 9)*(s**2 + s + 1), (s + 2)*(9*s - 9)*(s**2 + s + 1)**2, s),)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="o">-</span><span class="n">tfm_12</span> <span class="o">*</span> <span class="o">-</span><span class="n">tfm_8</span> <span class="o">*</span> <span class="o">-</span><span class="n">tfm_9</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">TransferFunctionMatrix</span><span class="p">)</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(3*(-3*a + 3*p)*(p + s)*(s + 2)*(s**2 + s + 1)**2 + 3*(-3*a - 3*s)*(p + s)*(s + 2)*(9*s - 9)*(s**2 + s + 1) + 3*(a + s)*(s + 2)**2*(9*s - 9)*(-p**4 + 3*p - 2)*(s**2 + s + 1), (p + s)*(s + 2)**3*(9*s - 9)*(s**2 + s + 1)**2, s),), (TransferFunction(3*(-a + p)*(p + s)*(s + 2)**2*(-p**4 + 3*p - 2)*(s**2 + s + 1) + 3*(3*a + 3*s)*(p + s)**2*(s + 2)*(9*s - 9) + 3*(p + s)*(s + 2)*(9*s - 9)*(-3*p**4 + 9*p - 6)*(s**2 + s + 1), (p + s)**2*(s + 2)**3*(9*s - 9)*(s**2 + s + 1), s),)))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.TransferFunction" title="sympy.physics.control.lti.TransferFunction"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TransferFunction</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.MIMOSeries" title="sympy.physics.control.lti.MIMOSeries"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MIMOSeries</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.MIMOParallel" title="sympy.physics.control.lti.MIMOParallel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MIMOParallel</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.Feedback" title="sympy.physics.control.lti.Feedback"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Feedback</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix.elem_poles">
<span class="sig-name descname"><span class="pre">elem_poles</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L2859-L2887"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix.elem_poles" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the poles of each element of the <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Actual poles of a MIMO system are NOT the poles of individual elements.</p>
</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_4</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">10</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_1</span><span class="p">,</span> <span class="n">tf_2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_3</span><span class="p">,</span> <span class="n">tf_4</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(3, s + 1, s), TransferFunction(s + 6, (s + 1)*(s + 2), s)), (TransferFunction(s + 3, s**2 + 3*s + 2, s), TransferFunction(s + 2, s**2 + 5*s - 10, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span><span class="o">.</span><span class="n">elem_poles</span><span class="p">()</span>
<span class="go">[[[-1], [-2, -1]], [[-2, -1], [-5/2 + sqrt(65)/2, -sqrt(65)/2 - 5/2]]]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.TransferFunctionMatrix.elem_zeros" title="sympy.physics.control.lti.TransferFunctionMatrix.elem_zeros"><code class="xref py py-obj docutils literal notranslate"><span class="pre">elem_zeros</span></code></a></p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix.elem_zeros">
<span class="sig-name descname"><span class="pre">elem_zeros</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L2889-L2917"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix.elem_zeros" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the zeros of each element of the <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Actual zeros of a MIMO system are NOT the zeros of individual elements.</p>
</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf_4</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">9</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">20</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mi">10</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf_1</span><span class="p">,</span> <span class="n">tf_2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf_3</span><span class="p">,</span> <span class="n">tf_4</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(3, s + 1, s), TransferFunction(s + 6, (s + 1)*(s + 2), s)), (TransferFunction(s + 3, s**2 + 3*s + 2, s), TransferFunction(s**2 - 9*s + 20, s**2 + 5*s - 10, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span><span class="o">.</span><span class="n">elem_zeros</span><span class="p">()</span>
<span class="go">[[[], [-6]], [[-3], [4, 5]]]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.TransferFunctionMatrix.elem_poles" title="sympy.physics.control.lti.TransferFunctionMatrix.elem_poles"><code class="xref py py-obj docutils literal notranslate"><span class="pre">elem_poles</span></code></a></p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix.expand">
<span class="sig-name descname"><span class="pre">expand</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L2933-L2936"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix.expand" title="Permalink to this definition">¶</a></dt>
<dd><p>Expands the transfer function matrix</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix.from_Matrix">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">from_Matrix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">matrix</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">var</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L2683-L2718"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix.from_Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a new <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code> efficiently from a SymPy Matrix of <code class="docutils literal notranslate"><span class="pre">Expr</span></code> objects.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>matrix</strong> : <code class="docutils literal notranslate"><span class="pre">ImmutableMatrix</span></code> having <code class="docutils literal notranslate"><span class="pre">Expr</span></code>/<code class="docutils literal notranslate"><span class="pre">Number</span></code> elements.</p>
<p><strong>var</strong> : Symbol</p>
<blockquote>
<div><p>Complex variable of the Laplace transform which will be used by the
all the <code class="docutils literal notranslate"><span class="pre">TransferFunction</span></code> objects in the <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Matrix</span><span class="p">,</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">Matrix</span><span class="p">([[</span><span class="n">s</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="o">/</span><span class="p">(</span><span class="n">s</span><span class="o">+</span><span class="mi">1</span><span class="p">),</span> <span class="n">s</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M_tf</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">M</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">M_tf</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[  s    1]</span>
<span class="go">[  -    -]</span>
<span class="go">[  1    s]</span>
<span class="go">[        ]</span>
<span class="go">[  1    s]</span>
<span class="go">[-----  -]</span>
<span class="go">[s + 1  1]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M_tf</span><span class="o">.</span><span class="n">elem_poles</span><span class="p">()</span>
<span class="go">[[[], [0]], [[-1], []]]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M_tf</span><span class="o">.</span><span class="n">elem_zeros</span><span class="p">()</span>
<span class="go">[[[0], []], [[], [0]]]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix.num_inputs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">num_inputs</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix.num_inputs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the number of inputs of the system.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">p</span> <span class="o">-</span> <span class="mi">3</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">G2</span><span class="p">,</span> <span class="o">-</span><span class="n">G1</span><span class="p">,</span> <span class="n">G3</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="n">G2</span><span class="p">,</span> <span class="o">-</span><span class="n">G1</span><span class="p">,</span> <span class="o">-</span><span class="n">G3</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span><span class="o">.</span><span class="n">num_inputs</span>
<span class="go">3</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.TransferFunctionMatrix.num_outputs" title="sympy.physics.control.lti.TransferFunctionMatrix.num_outputs"><code class="xref py py-obj docutils literal notranslate"><span class="pre">num_outputs</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix.num_outputs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">num_outputs</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix.num_outputs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the number of outputs of the system.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Matrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M_1</span> <span class="o">=</span> <span class="n">Matrix</span><span class="p">([[</span><span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="o">/</span><span class="n">s</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">TFM</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">M_1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">TFM</span><span class="p">)</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(s, 1, s),), (TransferFunction(1, s, s),)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">TFM</span><span class="o">.</span><span class="n">num_outputs</span>
<span class="go">2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.TransferFunctionMatrix.num_inputs" title="sympy.physics.control.lti.TransferFunctionMatrix.num_inputs"><code class="xref py py-obj docutils literal notranslate"><span class="pre">num_inputs</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix.shape">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">shape</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix.shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the shape of the transfer function matrix, that is, <code class="docutils literal notranslate"><span class="pre">(#</span> <span class="pre">of</span> <span class="pre">outputs,</span> <span class="pre">#</span> <span class="pre">of</span> <span class="pre">inputs)</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">3</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">7</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="o">-</span><span class="n">tf2</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm1</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(1, 2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="o">-</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf3</span><span class="p">],</span> <span class="p">[</span><span class="n">tf1</span><span class="p">,</span> <span class="o">-</span><span class="n">tf1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm2</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(2, 2)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix.transpose">
<span class="sig-name descname"><span class="pre">transpose</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L2854-L2857"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix.transpose" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the transpose of the <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code> (switched input and output layers).</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.TransferFunctionMatrix.var">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">var</span></span><a class="headerlink" href="#sympy.physics.control.lti.TransferFunctionMatrix.var" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complex variable used by all the transfer functions or
<code class="docutils literal notranslate"><span class="pre">Series</span></code>/<code class="docutils literal notranslate"><span class="pre">Parallel</span></code> objects in a transfer function matrix.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">Series</span><span class="p">,</span> <span class="n">Parallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">p</span> <span class="o">-</span> <span class="mi">6</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="mi">4</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G4</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S1</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="n">G1</span><span class="p">,</span> <span class="n">G2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">S2</span> <span class="o">=</span> <span class="n">Series</span><span class="p">(</span><span class="o">-</span><span class="n">G3</span><span class="p">,</span> <span class="n">Parallel</span><span class="p">(</span><span class="n">G2</span><span class="p">,</span> <span class="o">-</span><span class="n">G1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">G1</span><span class="p">],</span> <span class="p">[</span><span class="n">G2</span><span class="p">],</span> <span class="p">[</span><span class="n">G3</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm1</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="o">-</span><span class="n">S1</span><span class="p">,</span> <span class="o">-</span><span class="n">S2</span><span class="p">],</span> <span class="p">[</span><span class="n">S1</span><span class="p">,</span> <span class="n">S2</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm2</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm3</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">G4</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm3</span><span class="o">.</span><span class="n">var</span>
<span class="go">s</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOSeries">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.control.lti.</span></span><span class="sig-name descname"><span class="pre">MIMOSeries</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evaluate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1045-L1239"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.MIMOSeries" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing a series configuration of MIMO systems.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>args</strong> : MIMOLinearTimeInvariant</p>
<blockquote>
<div><p>MIMO systems in a series configuration.</p>
</div></blockquote>
<p><strong>evaluate</strong> : Boolean, Keyword</p>
<blockquote>
<div><p>When passed <code class="docutils literal notranslate"><span class="pre">True</span></code>, returns the equivalent
<code class="docutils literal notranslate"><span class="pre">MIMOSeries(*args).doit()</span></code>. Set to <code class="docutils literal notranslate"><span class="pre">False</span></code> by default.</p>
</div></blockquote>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong></p>
<blockquote>
<div><p>When no argument is passed.</p>
<p><code class="docutils literal notranslate"><span class="pre">var</span></code> attribute is not same for every system.</p>
<p><code class="docutils literal notranslate"><span class="pre">num_outputs</span></code> of the MIMO system is not equal to the
<code class="docutils literal notranslate"><span class="pre">num_inputs</span></code> of its adjacent MIMO system. (Matrix
multiplication constraint, basically)</p>
</div></blockquote>
<p><strong>TypeError</strong></p>
<blockquote>
<div><p>Any of the passed <code class="docutils literal notranslate"><span class="pre">*args</span></code> has unsupported type</p>
<p>A combination of SISO and MIMO systems is
passed. There should be homogeneity in the
type of systems passed, MIMO in this case.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">MIMOSeries</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Matrix</span><span class="p">,</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mat_a</span> <span class="o">=</span> <span class="n">Matrix</span><span class="p">([[</span><span class="mi">5</span><span class="o">*</span><span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="mi">5</span><span class="p">]])</span>  <span class="c1"># 2 Outputs 1 Input</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mat_b</span> <span class="o">=</span> <span class="n">Matrix</span><span class="p">([[</span><span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="p">(</span><span class="mi">6</span><span class="o">*</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">)]])</span>  <span class="c1"># 1 Output 2 Inputs</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mat_c</span> <span class="o">=</span> <span class="n">Matrix</span><span class="p">([[</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="mi">5</span><span class="o">/</span><span class="n">s</span><span class="p">,</span> <span class="mi">1</span><span class="p">]])</span>  <span class="c1"># 2 Outputs 2 Inputs</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_a</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">mat_a</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_b</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">mat_b</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_c</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">mat_c</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">MIMOSeries</span><span class="p">(</span><span class="n">tfm_c</span><span class="p">,</span> <span class="n">tfm_b</span><span class="p">,</span> <span class="n">tfm_a</span><span class="p">)</span>
<span class="go">MIMOSeries(TransferFunctionMatrix(((TransferFunction(1, 1, s), TransferFunction(s, 1, s)), (TransferFunction(5, s, s), TransferFunction(1, 1, s)))), TransferFunctionMatrix(((TransferFunction(5, 1, s), TransferFunction(1, 6*s**2, s)),)), TransferFunctionMatrix(((TransferFunction(5*s, 1, s),), (TransferFunction(5, 1, s),))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>  <span class="c1">#  For Better Visualization</span>
<span class="go">[5*s]                 [1  s]</span>
<span class="go">[---]    [5   1  ]    [-  -]</span>
<span class="go">[ 1 ]    [-  ----]    [1  1]</span>
<span class="go">[   ]   *[1     2]   *[    ]</span>
<span class="go">[ 5 ]    [   6*s ]{t} [5  1]</span>
<span class="go">[ - ]                 [-  -]</span>
<span class="go">[ 1 ]{t}              [s  1]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">MIMOSeries</span><span class="p">(</span><span class="n">tfm_c</span><span class="p">,</span> <span class="n">tfm_b</span><span class="p">,</span> <span class="n">tfm_a</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(150*s**4 + 25*s, 6*s**3, s), TransferFunction(150*s**4 + 5*s, 6*s**2, s)), (TransferFunction(150*s**3 + 25, 6*s**3, s), TransferFunction(150*s**3 + 5, 6*s**2, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>  <span class="c1"># (2 Inputs -A-&gt; 2 Outputs) -&gt; (2 Inputs -B-&gt; 1 Output) -&gt; (1 Input -C-&gt; 2 Outputs) is equivalent to (2 Inputs -Series Equivalent-&gt; 2 Outputs).</span>
<span class="go">[     4              4      ]</span>
<span class="go">[150*s  + 25*s  150*s  + 5*s]</span>
<span class="go">[-------------  ------------]</span>
<span class="go">[        3             2    ]</span>
<span class="go">[     6*s           6*s     ]</span>
<span class="go">[                           ]</span>
<span class="go">[      3              3     ]</span>
<span class="go">[ 150*s  + 25    150*s  + 5 ]</span>
<span class="go">[ -----------    ---------- ]</span>
<span class="go">[        3             2    ]</span>
<span class="go">[     6*s           6*s     ]{t}</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>All the transfer function matrices should use the same complex variable <code class="docutils literal notranslate"><span class="pre">var</span></code> of the Laplace transform.</p>
<p><code class="docutils literal notranslate"><span class="pre">MIMOSeries(A,</span> <span class="pre">B)</span></code> is not equivalent to <code class="docutils literal notranslate"><span class="pre">A*B</span></code>. It is always in the reverse order, that is <code class="docutils literal notranslate"><span class="pre">B*A</span></code>.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.Series" title="sympy.physics.control.lti.Series"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Series</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.MIMOParallel" title="sympy.physics.control.lti.MIMOParallel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MIMOParallel</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOSeries.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cancel</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1175-L1202"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.MIMOSeries.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the resultant transfer function matrix obtained after evaluating
the MIMO systems arranged in a series configuration.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">MIMOSeries</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf2</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">],</span> <span class="p">[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">MIMOSeries</span><span class="p">(</span><span class="n">tfm2</span><span class="p">,</span> <span class="n">tfm1</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(2*(-p + s)*(s**3 - 2)*(a*p**2 + b*s)*(s**4 + 5*s + 6), (-p + s)**2*(s**4 + 5*s + 6)**2, s), TransferFunction((-p + s)**2*(s**3 - 2)*(a*p**2 + b*s) + (-p + s)*(a*p**2 + b*s)**2*(s**4 + 5*s + 6), (-p + s)**3*(s**4 + 5*s + 6), s)), (TransferFunction((-p + s)*(s**3 - 2)**2*(s**4 + 5*s + 6) + (s**3 - 2)*(a*p**2 + b*s)*(s**4 + 5*s + 6)**2, (-p + s)*(s**4 + 5*s + 6)**3, s), TransferFunction(2*(s**3 - 2)*(a*p**2 + b*s), (-p + s)*(s**4 + 5*s + 6), s))))</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOSeries.num_inputs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">num_inputs</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOSeries.num_inputs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the number of input signals of the series system.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOSeries.num_outputs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">num_outputs</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOSeries.num_outputs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the number of output signals of the series system.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOSeries.shape">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">shape</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOSeries.shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the shape of the equivalent MIMO system.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOSeries.var">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">var</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOSeries.var" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complex variable used by all the transfer functions.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">MIMOSeries</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">p</span> <span class="o">-</span> <span class="mi">6</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="mi">4</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">G1</span><span class="p">,</span> <span class="n">G2</span><span class="p">,</span> <span class="n">G3</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">G1</span><span class="p">],</span> <span class="p">[</span><span class="n">G2</span><span class="p">],</span> <span class="p">[</span><span class="n">G3</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">MIMOSeries</span><span class="p">(</span><span class="n">tfm_2</span><span class="p">,</span> <span class="n">tfm_1</span><span class="p">)</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOParallel">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.control.lti.</span></span><span class="sig-name descname"><span class="pre">MIMOParallel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evaluate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1474-L1656"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.MIMOParallel" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing a parallel configuration of MIMO systems.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>args</strong> : MIMOLinearTimeInvariant</p>
<blockquote>
<div><p>MIMO Systems in a parallel arrangement.</p>
</div></blockquote>
<p><strong>evaluate</strong> : Boolean, Keyword</p>
<blockquote>
<div><p>When passed <code class="docutils literal notranslate"><span class="pre">True</span></code>, returns the equivalent
<code class="docutils literal notranslate"><span class="pre">MIMOParallel(*args).doit()</span></code>. Set to <code class="docutils literal notranslate"><span class="pre">False</span></code> by default.</p>
</div></blockquote>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong></p>
<blockquote>
<div><p>When no argument is passed.</p>
<p><code class="docutils literal notranslate"><span class="pre">var</span></code> attribute is not same for every system.</p>
<p>All MIMO systems passed don’t have same shape.</p>
</div></blockquote>
<p><strong>TypeError</strong></p>
<blockquote>
<div><p>Any of the passed <code class="docutils literal notranslate"><span class="pre">*args</span></code> has unsupported type</p>
<p>A combination of SISO and MIMO systems is
passed. There should be homogeneity in the
type of systems passed, MIMO in this case.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">MIMOParallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Matrix</span><span class="p">,</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr_1</span> <span class="o">=</span> <span class="mi">1</span><span class="o">/</span><span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr_2</span> <span class="o">=</span> <span class="n">s</span><span class="o">/</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr_3</span> <span class="o">=</span> <span class="p">(</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr_4</span> <span class="o">=</span> <span class="mi">5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_a</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">Matrix</span><span class="p">([[</span><span class="n">expr_1</span><span class="p">,</span> <span class="n">expr_2</span><span class="p">],</span> <span class="p">[</span><span class="n">expr_3</span><span class="p">,</span> <span class="n">expr_4</span><span class="p">]]),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_b</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">Matrix</span><span class="p">([[</span><span class="n">expr_2</span><span class="p">,</span> <span class="n">expr_1</span><span class="p">],</span> <span class="p">[</span><span class="n">expr_4</span><span class="p">,</span> <span class="n">expr_3</span><span class="p">]]),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_c</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">Matrix</span><span class="p">([[</span><span class="n">expr_3</span><span class="p">,</span> <span class="n">expr_4</span><span class="p">],</span> <span class="p">[</span><span class="n">expr_1</span><span class="p">,</span> <span class="n">expr_2</span><span class="p">]]),</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">MIMOParallel</span><span class="p">(</span><span class="n">tfm_a</span><span class="p">,</span> <span class="n">tfm_b</span><span class="p">,</span> <span class="n">tfm_c</span><span class="p">)</span>
<span class="go">MIMOParallel(TransferFunctionMatrix(((TransferFunction(1, s, s), TransferFunction(s, s**2 - 1, s)), (TransferFunction(s + 2, s**2 - 1, s), TransferFunction(5, 1, s)))), TransferFunctionMatrix(((TransferFunction(s, s**2 - 1, s), TransferFunction(1, s, s)), (TransferFunction(5, 1, s), TransferFunction(s + 2, s**2 - 1, s)))), TransferFunctionMatrix(((TransferFunction(s + 2, s**2 - 1, s), TransferFunction(5, 1, s)), (TransferFunction(1, s, s), TransferFunction(s, s**2 - 1, s)))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>  <span class="c1">#  For Better Visualization</span>
<span class="go">[  1       s   ]      [  s       1   ]      [s + 2     5   ]</span>
<span class="go">[  -     ------]      [------    -   ]      [------    -   ]</span>
<span class="go">[  s      2    ]      [ 2        s   ]      [ 2        1   ]</span>
<span class="go">[        s  - 1]      [s  - 1        ]      [s  - 1        ]</span>
<span class="go">[              ]    + [              ]    + [              ]</span>
<span class="go">[s + 2     5   ]      [  5     s + 2 ]      [  1       s   ]</span>
<span class="go">[------    -   ]      [  -     ------]      [  -     ------]</span>
<span class="go">[ 2        1   ]      [  1      2    ]      [  s      2    ]</span>
<span class="go">[s  - 1        ]{t}   [        s  - 1]{t}   [        s  - 1]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">MIMOParallel</span><span class="p">(</span><span class="n">tfm_a</span><span class="p">,</span> <span class="n">tfm_b</span><span class="p">,</span> <span class="n">tfm_c</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(s**2 + s*(2*s + 2) - 1, s*(s**2 - 1), s), TransferFunction(2*s**2 + 5*s*(s**2 - 1) - 1, s*(s**2 - 1), s)), (TransferFunction(s**2 + s*(s + 2) + 5*s*(s**2 - 1) - 1, s*(s**2 - 1), s), TransferFunction(5*s**2 + 2*s - 3, s**2 - 1, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[       2                              2       / 2    \    ]</span>
<span class="go">[      s  + s*(2*s + 2) - 1         2*s  + 5*s*\s  - 1/ - 1]</span>
<span class="go">[      --------------------         -----------------------]</span>
<span class="go">[             / 2    \                       / 2    \      ]</span>
<span class="go">[           s*\s  - 1/                     s*\s  - 1/      ]</span>
<span class="go">[                                                          ]</span>
<span class="go">[ 2                   / 2    \             2               ]</span>
<span class="go">[s  + s*(s + 2) + 5*s*\s  - 1/ - 1      5*s  + 2*s - 3     ]</span>
<span class="go">[---------------------------------      --------------     ]</span>
<span class="go">[              / 2    \                      2             ]</span>
<span class="go">[            s*\s  - 1/                     s  - 1         ]{t}</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>All the transfer function matrices should use the same complex variable
<code class="docutils literal notranslate"><span class="pre">var</span></code> of the Laplace transform.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.Parallel" title="sympy.physics.control.lti.Parallel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Parallel</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.MIMOSeries" title="sympy.physics.control.lti.MIMOSeries"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MIMOSeries</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOParallel.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1605-L1625"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.MIMOParallel.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the resultant transfer function matrix obtained after evaluating
the MIMO systems arranged in a parallel configuration.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">MIMOParallel</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">4</span> <span class="o">+</span> <span class="mi">5</span><span class="o">*</span><span class="n">s</span> <span class="o">+</span> <span class="mi">6</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">],</span> <span class="p">[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">MIMOParallel</span><span class="p">(</span><span class="n">tfm_1</span><span class="p">,</span> <span class="n">tfm_2</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">TransferFunctionMatrix(((TransferFunction((-p + s)*(s**3 - 2) + (a*p**2 + b*s)*(s**4 + 5*s + 6), (-p + s)*(s**4 + 5*s + 6), s), TransferFunction((-p + s)*(s**3 - 2) + (a*p**2 + b*s)*(s**4 + 5*s + 6), (-p + s)*(s**4 + 5*s + 6), s)), (TransferFunction((-p + s)*(s**3 - 2) + (a*p**2 + b*s)*(s**4 + 5*s + 6), (-p + s)*(s**4 + 5*s + 6), s), TransferFunction((-p + s)*(s**3 - 2) + (a*p**2 + b*s)*(s**4 + 5*s + 6), (-p + s)*(s**4 + 5*s + 6), s))))</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOParallel.num_inputs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">num_inputs</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOParallel.num_inputs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the number of input signals of the parallel system.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOParallel.num_outputs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">num_outputs</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOParallel.num_outputs" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the number of output signals of the parallel system.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOParallel.shape">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">shape</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOParallel.shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the shape of the equivalent MIMO system.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOParallel.var">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">var</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOParallel.var" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complex variable used by all the systems.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">MIMOParallel</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">p</span> <span class="o">+</span> <span class="mi">4</span><span class="p">,</span> <span class="n">p</span> <span class="o">-</span> <span class="mi">6</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="mi">4</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">G4</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">p</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_a</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">G1</span><span class="p">,</span> <span class="n">G2</span><span class="p">],</span> <span class="p">[</span><span class="n">G3</span><span class="p">,</span> <span class="n">G4</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tfm_b</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">G2</span><span class="p">,</span> <span class="n">G1</span><span class="p">],</span> <span class="p">[</span><span class="n">G4</span><span class="p">,</span> <span class="n">G3</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">MIMOParallel</span><span class="p">(</span><span class="n">tfm_a</span><span class="p">,</span> <span class="n">tfm_b</span><span class="p">)</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOFeedback">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.control.lti.</span></span><span class="sig-name descname"><span class="pre">MIMOFeedback</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sys1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sys2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sign</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L1945-L2289"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.MIMOFeedback" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for representing closed-loop feedback interconnection between two
MIMO input/output systems.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>sys1</strong> : MIMOSeries, TransferFunctionMatrix</p>
<blockquote>
<div><p>The MIMO system placed on the feedforward path.</p>
</div></blockquote>
<p><strong>sys2</strong> : MIMOSeries, TransferFunctionMatrix</p>
<blockquote>
<div><p>The system placed on the feedback path
(often a feedback controller).</p>
</div></blockquote>
<p><strong>sign</strong> : int, optional</p>
<blockquote>
<div><p>The sign of feedback. Can either be <code class="docutils literal notranslate"><span class="pre">1</span></code>
(for positive feedback) or <code class="docutils literal notranslate"><span class="pre">-1</span></code> (for negative feedback).
Default value is <span class="math notranslate nohighlight">\(-1\)</span>.</p>
</div></blockquote>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong></p>
<blockquote>
<div><p>When <code class="docutils literal notranslate"><span class="pre">sys1</span></code> and <code class="docutils literal notranslate"><span class="pre">sys2</span></code> are not using the
same complex variable of the Laplace transform.</p>
<p>Forward path model should have an equal number of inputs/outputs
to the feedback path outputs/inputs.</p>
<p>When product of <code class="docutils literal notranslate"><span class="pre">sys1</span></code> and <code class="docutils literal notranslate"><span class="pre">sys2</span></code> is not a square matrix.</p>
<p>When the equivalent MIMO system is not invertible.</p>
</div></blockquote>
<p><strong>TypeError</strong></p>
<blockquote>
<div><p>When either <code class="docutils literal notranslate"><span class="pre">sys1</span></code> or <code class="docutils literal notranslate"><span class="pre">sys2</span></code> is not a <code class="docutils literal notranslate"><span class="pre">MIMOSeries</span></code> or a
<code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code> object.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Matrix</span><span class="p">,</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">MIMOFeedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plant_mat</span> <span class="o">=</span> <span class="n">Matrix</span><span class="p">([[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">controller_mat</span> <span class="o">=</span> <span class="n">Matrix</span><span class="p">([[</span><span class="mi">10</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="p">]])</span>  <span class="c1"># Constant Gain</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plant</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">plant_mat</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">controller</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="o">.</span><span class="n">from_Matrix</span><span class="p">(</span><span class="n">controller_mat</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">feedback</span> <span class="o">=</span> <span class="n">MIMOFeedback</span><span class="p">(</span><span class="n">plant</span><span class="p">,</span> <span class="n">controller</span><span class="p">)</span>  <span class="c1"># Negative Feedback (default)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">feedback</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">/    [1  1]    [10  0 ]   \-1   [1  1]</span>
<span class="go">|    [-  -]    [--  - ]   |     [-  -]</span>
<span class="go">|    [1  s]    [1   1 ]   |     [1  s]</span>
<span class="go">|I + [    ]   *[      ]   |   * [    ]</span>
<span class="go">|    [0  1]    [0   10]   |     [0  1]</span>
<span class="go">|    [-  -]    [-   --]   |     [-  -]</span>
<span class="go">\    [1  1]{t} [1   1 ]{t}/     [1  1]{t}</span>
</pre></div>
</div>
<p>To get the equivalent system matrix, use either <code class="docutils literal notranslate"><span class="pre">doit</span></code> or <code class="docutils literal notranslate"><span class="pre">rewrite</span></code> method.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">feedback</span><span class="o">.</span><span class="n">doit</span><span class="p">(),</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[1     1  ]</span>
<span class="go">[--  -----]</span>
<span class="go">[11  121*s]</span>
<span class="go">[         ]</span>
<span class="go">[0    1   ]</span>
<span class="go">[-    --  ]</span>
<span class="go">[1    11  ]{t}</span>
</pre></div>
</div>
<p>To negate the <code class="docutils literal notranslate"><span class="pre">MIMOFeedback</span></code> object, use <code class="docutils literal notranslate"><span class="pre">-</span></code> operator.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">neg_feedback</span> <span class="o">=</span> <span class="o">-</span><span class="n">feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">neg_feedback</span><span class="o">.</span><span class="n">doit</span><span class="p">(),</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[-1    -1  ]</span>
<span class="go">[---  -----]</span>
<span class="go">[ 11  121*s]</span>
<span class="go">[          ]</span>
<span class="go">[ 0    -1  ]</span>
<span class="go">[ -    --- ]</span>
<span class="go">[ 1     11 ]{t}</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.physics.control.lti.Feedback" title="sympy.physics.control.lti.Feedback"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Feedback</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.MIMOSeries" title="sympy.physics.control.lti.MIMOSeries"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MIMOSeries</span></code></a>, <a class="reference internal" href="#sympy.physics.control.lti.MIMOParallel" title="sympy.physics.control.lti.MIMOParallel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MIMOParallel</span></code></a></p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOFeedback.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cancel</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expand</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/control/lti.py#L2208-L2283"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.control.lti.MIMOFeedback.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the resultant transfer function matrix obtained by the
feedback interconnection.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">MIMOFeedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="mi">1</span> <span class="o">-</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf4</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf5</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf3</span><span class="p">,</span> <span class="n">tf4</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf3</span><span class="p">,</span> <span class="n">tf5</span><span class="p">],</span> <span class="p">[</span><span class="n">tf5</span><span class="p">,</span> <span class="n">tf5</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span> <span class="o">=</span> <span class="n">MIMOFeedback</span><span class="p">(</span><span class="n">sys1</span><span class="p">,</span> <span class="n">sys2</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">F_1</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">/    [  s      1  ]    [5  0]   \-1   [  s      1  ]</span>
<span class="go">|    [-----    -  ]    [-  -]   |     [-----    -  ]</span>
<span class="go">|    [1 - s    s  ]    [1  1]   |     [1 - s    s  ]</span>
<span class="go">|I - [            ]   *[    ]   |   * [            ]</span>
<span class="go">|    [  5    s - 1]    [0  0]   |     [  5    s - 1]</span>
<span class="go">|    [  -    -----]    [-  -]   |     [  -    -----]</span>
<span class="go">\    [  1      s  ]{t} [1  1]{t}/     [  1      s  ]{t}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">F_1</span><span class="o">.</span><span class="n">doit</span><span class="p">(),</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[               -s                         1 - s       ]</span>
<span class="go">[             -------                   -----------    ]</span>
<span class="go">[             6*s - 1                   s*(1 - 6*s)    ]</span>
<span class="go">[                                                      ]</span>
<span class="go">[25*s*(s - 1) + 5*(1 - s)*(6*s - 1)  (s - 1)*(6*s + 24)]</span>
<span class="go">[----------------------------------  ------------------]</span>
<span class="go">[        (1 - s)*(6*s - 1)              s*(6*s - 1)    ]{t}</span>
</pre></div>
</div>
<p>If the user wants the resultant <code class="docutils literal notranslate"><span class="pre">TransferFunctionMatrix</span></code> object without
canceling the common factors then the <code class="docutils literal notranslate"><span class="pre">cancel</span></code> kwarg should be passed <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">F_1</span><span class="o">.</span><span class="n">doit</span><span class="p">(</span><span class="n">cancel</span><span class="o">=</span><span class="kc">False</span><span class="p">),</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[           25*s*(1 - s)                          25 - 25*s              ]</span>
<span class="go">[       --------------------                    --------------           ]</span>
<span class="go">[       25*(1 - 6*s)*(1 - s)                    25*s*(1 - 6*s)           ]</span>
<span class="go">[                                                                        ]</span>
<span class="go">[s*(25*s - 25) + 5*(1 - s)*(6*s - 1)  s*(s - 1)*(6*s - 1) + s*(25*s - 25)]</span>
<span class="go">[-----------------------------------  -----------------------------------]</span>
<span class="go">[         (1 - s)*(6*s - 1)                        2                     ]</span>
<span class="go">[                                                 s *(6*s - 1)           ]{t}</span>
</pre></div>
</div>
<p>If the user wants the expanded form of the resultant transfer function matrix,
the <code class="docutils literal notranslate"><span class="pre">expand</span></code> kwarg should be passed as <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">F_1</span><span class="o">.</span><span class="n">doit</span><span class="p">(</span><span class="n">expand</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[       -s               1 - s      ]</span>
<span class="go">[     -------          ----------   ]</span>
<span class="go">[     6*s - 1               2       ]</span>
<span class="go">[                      - 6*s  + s   ]</span>
<span class="go">[                                   ]</span>
<span class="go">[     2                2            ]</span>
<span class="go">[- 5*s  + 10*s - 5  6*s  + 18*s - 24]</span>
<span class="go">[-----------------  ----------------]</span>
<span class="go">[      2                   2        ]</span>
<span class="go">[ - 6*s  + 7*s - 1      6*s  - s    ]{t}</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOFeedback.sensitivity">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">sensitivity</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOFeedback.sensitivity" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the sensitivity function matrix of the feedback loop.</p>
<p>Sensitivity of a closed-loop system is the ratio of change
in the open loop gain to the change in the closed loop gain.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This method would not return the complementary
sensitivity function.</p>
</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">MIMOFeedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="mi">1</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf3</span><span class="p">],</span> <span class="p">[</span><span class="n">tf3</span><span class="p">,</span> <span class="n">tf2</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span> <span class="o">=</span> <span class="n">MIMOFeedback</span><span class="p">(</span><span class="n">sys1</span><span class="p">,</span> <span class="n">sys2</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>  <span class="c1"># Positive feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_2</span> <span class="o">=</span> <span class="n">MIMOFeedback</span><span class="p">(</span><span class="n">sys1</span><span class="p">,</span> <span class="n">sys2</span><span class="p">)</span>  <span class="c1"># Negative feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">F_1</span><span class="o">.</span><span class="n">sensitivity</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[   4      3      2               5      4      2           ]</span>
<span class="go">[- p  + 3*p  - 4*p  + 3*p - 1    p  - 2*p  + 3*p  - 3*p + 1 ]</span>
<span class="go">[----------------------------  -----------------------------]</span>
<span class="go">[  4      3      2              5      4      3      2      ]</span>
<span class="go">[ p  + 3*p  - 8*p  + 8*p - 3   p  + 3*p  - 8*p  + 8*p  - 3*p]</span>
<span class="go">[                                                           ]</span>
<span class="go">[       4    3    2                  3      2               ]</span>
<span class="go">[      p  - p  - p  + p           3*p  - 6*p  + 4*p - 1     ]</span>
<span class="go">[ --------------------------    --------------------------  ]</span>
<span class="go">[  4      3      2               4      3      2            ]</span>
<span class="go">[ p  + 3*p  - 8*p  + 8*p - 3    p  + 3*p  - 8*p  + 8*p - 3  ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">F_2</span><span class="o">.</span><span class="n">sensitivity</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[ 4      3      2           5      4      2          ]</span>
<span class="go">[p  - 3*p  + 2*p  + p - 1  p  - 2*p  + 3*p  - 3*p + 1]</span>
<span class="go">[------------------------  --------------------------]</span>
<span class="go">[   4      3                   5      4      2       ]</span>
<span class="go">[  p  - 3*p  + 2*p - 1        p  - 3*p  + 2*p  - p   ]</span>
<span class="go">[                                                    ]</span>
<span class="go">[     4    3    2               4      3             ]</span>
<span class="go">[    p  - p  - p  + p        2*p  - 3*p  + 2*p - 1   ]</span>
<span class="go">[  -------------------       ---------------------   ]</span>
<span class="go">[   4      3                   4      3              ]</span>
<span class="go">[  p  - 3*p  + 2*p - 1        p  - 3*p  + 2*p - 1    ]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOFeedback.sign">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">sign</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOFeedback.sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the type of feedback interconnection of two models. <code class="docutils literal notranslate"><span class="pre">1</span></code>
for Positive and <code class="docutils literal notranslate"><span class="pre">-1</span></code> for Negative.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOFeedback.sys1">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">sys1</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOFeedback.sys1" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the system placed on the feedforward path of the MIMO feedback interconnection.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">MIMOFeedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf3</span><span class="p">,</span> <span class="n">tf3</span><span class="p">],</span> <span class="p">[</span><span class="n">tf3</span><span class="p">,</span> <span class="n">tf2</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span> <span class="o">=</span> <span class="n">MIMOFeedback</span><span class="p">(</span><span class="n">sys1</span><span class="p">,</span> <span class="n">sys2</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span><span class="o">.</span><span class="n">sys1</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(s**2 + s + 1, s**2 - s + 1, s), TransferFunction(1, s, s)), (TransferFunction(1, s, s), TransferFunction(s**2 + s + 1, s**2 - s + 1, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[ 2                    ]</span>
<span class="go">[s  + s + 1      1     ]</span>
<span class="go">[----------      -     ]</span>
<span class="go">[ 2              s     ]</span>
<span class="go">[s  - s + 1            ]</span>
<span class="go">[                      ]</span>
<span class="go">[             2        ]</span>
<span class="go">[    1       s  + s + 1]</span>
<span class="go">[    -       ----------]</span>
<span class="go">[    s        2        ]</span>
<span class="go">[            s  - s + 1]{t}</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOFeedback.sys2">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">sys2</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOFeedback.sys2" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the feedback controller of the MIMO feedback interconnection.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">MIMOFeedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">s</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf3</span><span class="p">],</span> <span class="p">[</span><span class="n">tf3</span><span class="p">,</span> <span class="n">tf2</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span> <span class="o">=</span> <span class="n">MIMOFeedback</span><span class="p">(</span><span class="n">sys1</span><span class="p">,</span> <span class="n">sys2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span><span class="o">.</span><span class="n">sys2</span>
<span class="go">TransferFunctionMatrix(((TransferFunction(s**2, s**3 - s + 1, s), TransferFunction(1, 1, s)), (TransferFunction(1, 1, s), TransferFunction(1, s, s))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">[     2       ]</span>
<span class="go">[    s       1]</span>
<span class="go">[----------  -]</span>
<span class="go">[ 3          1]</span>
<span class="go">[s  - s + 1   ]</span>
<span class="go">[             ]</span>
<span class="go">[    1       1]</span>
<span class="go">[    -       -]</span>
<span class="go">[    1       s]{t}</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.control.lti.MIMOFeedback.var">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">var</span></span><a class="headerlink" href="#sympy.physics.control.lti.MIMOFeedback.var" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the complex variable of the Laplace transform used by all
the transfer functions involved in the MIMO feedback loop.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.control.lti</span> <span class="kn">import</span> <span class="n">TransferFunction</span><span class="p">,</span> <span class="n">TransferFunctionMatrix</span><span class="p">,</span> <span class="n">MIMOFeedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf1</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="mi">1</span> <span class="o">-</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf2</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tf3</span> <span class="o">=</span> <span class="n">TransferFunction</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys1</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf2</span><span class="p">],</span> <span class="p">[</span><span class="n">tf2</span><span class="p">,</span> <span class="n">tf1</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys2</span> <span class="o">=</span> <span class="n">TransferFunctionMatrix</span><span class="p">([[</span><span class="n">tf1</span><span class="p">,</span> <span class="n">tf3</span><span class="p">],</span> <span class="p">[</span><span class="n">tf3</span><span class="p">,</span> <span class="n">tf2</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span> <span class="o">=</span> <span class="n">MIMOFeedback</span><span class="p">(</span><span class="n">sys1</span><span class="p">,</span> <span class="n">sys2</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>  <span class="c1"># Positive feedback</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">F_1</span><span class="o">.</span><span class="n">var</span>
<span class="go">p</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../../index.html">
              <img class="logo" src="../../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Control API</a><ul>
<li><a class="reference internal" href="#module-sympy.physics.control.lti">lti</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="control.html"
                        title="previous chapter">Control</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="control_plots.html"
                        title="next chapter">Control System Plots</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../_sources/modules/physics/control/lti.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="control_plots.html" title="Control System Plots"
             >next</a> |</li>
        <li class="right" >
          <a href="control.html" title="Control"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="index.html" >Control Module</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Control API</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/physics/control/lti.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:27:31 GMT -->
</html>